diff --git a/.gitignore b/.gitignore index b849df0d06..d684262f9d 100644 --- a/.gitignore +++ b/.gitignore @@ -159,4 +159,6 @@ pcre2.h zconf.h version.h geos_c.h +source/libs/parser/src/sql.c +include/common/ttokenauto.h diff --git a/cmake/lemon_CMakeLists.txt.in b/cmake/lemon_CMakeLists.txt.in new file mode 100644 index 0000000000..26226d3eda --- /dev/null +++ b/cmake/lemon_CMakeLists.txt.in @@ -0,0 +1,11 @@ +# lemon + +ExternalProject_Add( + lemon + SOURCE_DIR ${TD_CONTRIB_DIR}/lemon + CONFIGURE_COMMAND "" + BUILD_COMMAND "${C_COMPILER_LEMON}" -o ${TD_CONTRIB_DIR}/lemon/lemon ${TD_CONTRIB_DIR}/lemon/lemon.c + INSTALL_COMMAND "" + BUILD_IN_SOURCE 1 + BUILD_ALWAYS 1 +) \ No newline at end of file diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index a9e51b7249..7741ae4e14 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -184,6 +184,17 @@ if(${BUILD_PCRE2}) cat("${TD_SUPPORT_DIR}/pcre2_CMakeLists.txt.in" ${CONTRIB_TMP_FILE}) endif() +find_program(C_COMPILER_LEMON NAMES gcc) +if(C_COMPILER_LEMON) + message(STATUS "LEMON C compiler: ${C_COMPILER_LEMON}") +else() + set(C_COMPILER_LEMON ${CMAKE_C_COMPILER}) + message(STATUS "LEMON C compiler: ${C_COMPILER_LEMON}") +endif() + +# lemon +cat("${TD_SUPPORT_DIR}/lemon_CMakeLists.txt.in" ${CONTRIB_TMP_FILE}) + # download dependencies configure_file(${CONTRIB_TMP_FILE} "${TD_CONTRIB_DIR}/deps-download/CMakeLists.txt") execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . diff --git a/contrib/lemon/lemon.c b/contrib/lemon/lemon.c new file mode 100644 index 0000000000..d92df2a1a7 --- /dev/null +++ b/contrib/lemon/lemon.c @@ -0,0 +1,6038 @@ +/* +** This file contains all sources (including headers) to the LEMON +** LALR(1) parser generator. The sources have been combined into a +** single file to make it easy to include LEMON in the source tree +** and Makefile of another program. +** +** The author of this program disclaims copyright. +*/ +#include +#include +#include +#include +#include +#include + +#define ISSPACE(X) isspace((unsigned char)(X)) +#define ISDIGIT(X) isdigit((unsigned char)(X)) +#define ISALNUM(X) isalnum((unsigned char)(X)) +#define ISALPHA(X) isalpha((unsigned char)(X)) +#define ISUPPER(X) isupper((unsigned char)(X)) +#define ISLOWER(X) islower((unsigned char)(X)) + + +#ifndef __WIN32__ +# if defined(_WIN32) || defined(WIN32) +# define __WIN32__ +# endif +#endif + +#ifdef __WIN32__ +#ifdef __cplusplus +extern "C" { +#endif +extern int access(const char *path, int mode); +#ifdef __cplusplus +} +#endif +#else +#include +#endif + +/* #define PRIVATE static */ +#define PRIVATE + +#ifdef TEST +#define MAXRHS 5 /* Set low to exercise exception code */ +#else +#define MAXRHS 1000 +#endif + +extern void memory_error(); +static int showPrecedenceConflict = 0; +static char *msort(char*,char**,int(*)(const char*,const char*)); + +/* +** Compilers are getting increasingly pedantic about type conversions +** as C evolves ever closer to Ada.... To work around the latest problems +** we have to define the following variant of strlen(). +*/ +#define lemonStrlen(X) ((int)strlen(X)) + +/* +** Header on the linked list of memory allocations. +*/ +typedef struct MemChunk MemChunk; +struct MemChunk { + MemChunk *pNext; + size_t sz; + /* Actually memory follows */ +}; + +/* +** Global linked list of all memory allocations. +*/ +static MemChunk *memChunkList = 0; + +/* +** Wrappers around malloc(), calloc(), realloc() and free(). +** +** All memory allocations are kept on a doubly-linked list. The +** lemon_free_all() function can be called prior to exit to clean +** up any memory leaks. +** +** This is not necessary. But compilers and getting increasingly +** fussy about memory leaks, even in command-line programs like Lemon +** where they do not matter. So this code is provided to hush the +** warnings. +*/ +static void *lemon_malloc(size_t nByte){ + MemChunk *p; + if( nByte<0 ) return 0; + p = malloc( nByte + sizeof(MemChunk) ); + if( p==0 ){ + fprintf(stderr, "Out of memory. Failed to allocate %lld bytes.\n", + (long long int)nByte); + exit(1); + } + p->pNext = memChunkList; + p->sz = nByte; + memChunkList = p; + return (void*)&p[1]; +} +static void *lemon_calloc(size_t nElem, size_t sz){ + void *p = lemon_malloc(nElem*sz); + memset(p, 0, nElem*sz); + return p; +} +static void lemon_free(void *pOld){ + if( pOld ){ + MemChunk *p = (MemChunk*)pOld; + p--; + memset(pOld, 0, p->sz); + } +} +static void *lemon_realloc(void *pOld, size_t nNew){ + void *pNew; + MemChunk *p; + if( pOld==0 ) return lemon_malloc(nNew); + p = (MemChunk*)pOld; + p--; + if( p->sz>=nNew ) return pOld; + pNew = lemon_malloc( nNew ); + memcpy(pNew, pOld, p->sz); + return pNew; +} + +/* Free all outstanding memory allocations. +** Do this right before exiting. +*/ +static void lemon_free_all(void){ + while( memChunkList ){ + MemChunk *pNext = memChunkList->pNext; + free( memChunkList ); + memChunkList = pNext; + } +} + +/* +** Compilers are starting to complain about the use of sprintf() and strcpy(), +** saying they are unsafe. So we define our own versions of those routines too. +** +** There are three routines here: lemon_sprintf(), lemon_vsprintf(), and +** lemon_addtext(). The first two are replacements for sprintf() and vsprintf(). +** The third is a helper routine for vsnprintf() that adds texts to the end of a +** buffer, making sure the buffer is always zero-terminated. +** +** The string formatter is a minimal subset of stdlib sprintf() supporting only +** a few simply conversions: +** +** %d +** %s +** %.*s +** +*/ +static void lemon_addtext( + char *zBuf, /* The buffer to which text is added */ + int *pnUsed, /* Slots of the buffer used so far */ + const char *zIn, /* Text to add */ + int nIn, /* Bytes of text to add. -1 to use strlen() */ + int iWidth /* Field width. Negative to left justify */ +){ + if( nIn<0 ) for(nIn=0; zIn[nIn]; nIn++){} + while( iWidth>nIn ){ zBuf[(*pnUsed)++] = ' '; iWidth--; } + if( nIn==0 ) return; + memcpy(&zBuf[*pnUsed], zIn, nIn); + *pnUsed += nIn; + while( (-iWidth)>nIn ){ zBuf[(*pnUsed)++] = ' '; iWidth++; } + zBuf[*pnUsed] = 0; +} +static int lemon_vsprintf(char *str, const char *zFormat, va_list ap){ + int i, j, k, c; + int nUsed = 0; + const char *z; + char zTemp[50]; + str[0] = 0; + for(i=j=0; (c = zFormat[i])!=0; i++){ + if( c=='%' ){ + int iWidth = 0; + lemon_addtext(str, &nUsed, &zFormat[j], i-j, 0); + c = zFormat[++i]; + if( ISDIGIT(c) || (c=='-' && ISDIGIT(zFormat[i+1])) ){ + if( c=='-' ) i++; + while( ISDIGIT(zFormat[i]) ) iWidth = iWidth*10 + zFormat[i++] - '0'; + if( c=='-' ) iWidth = -iWidth; + c = zFormat[i]; + } + if( c=='d' ){ + int v = va_arg(ap, int); + if( v<0 ){ + lemon_addtext(str, &nUsed, "-", 1, iWidth); + v = -v; + }else if( v==0 ){ + lemon_addtext(str, &nUsed, "0", 1, iWidth); + } + k = 0; + while( v>0 ){ + k++; + zTemp[sizeof(zTemp)-k] = (v%10) + '0'; + v /= 10; + } + lemon_addtext(str, &nUsed, &zTemp[sizeof(zTemp)-k], k, iWidth); + }else if( c=='s' ){ + z = va_arg(ap, const char*); + lemon_addtext(str, &nUsed, z, -1, iWidth); + }else if( c=='.' && memcmp(&zFormat[i], ".*s", 3)==0 ){ + i += 2; + k = va_arg(ap, int); + z = va_arg(ap, const char*); + lemon_addtext(str, &nUsed, z, k, iWidth); + }else if( c=='%' ){ + lemon_addtext(str, &nUsed, "%", 1, 0); + }else{ + fprintf(stderr, "illegal format\n"); + exit(1); + } + j = i+1; + } + } + lemon_addtext(str, &nUsed, &zFormat[j], i-j, 0); + return nUsed; +} +static int lemon_sprintf(char *str, const char *format, ...){ + va_list ap; + int rc; + va_start(ap, format); + rc = lemon_vsprintf(str, format, ap); + va_end(ap); + return rc; +} +static void lemon_strcpy(char *dest, const char *src){ + while( (*(dest++) = *(src++))!=0 ){} +} +static void lemon_strcat(char *dest, const char *src){ + while( *dest ) dest++; + lemon_strcpy(dest, src); +} + + +/* a few forward declarations... */ +struct rule; +struct lemon; +struct action; + +static struct action *Action_new(void); +static struct action *Action_sort(struct action *); + +/********** From the file "build.h" ************************************/ +void FindRulePrecedences(struct lemon*); +void FindFirstSets(struct lemon*); +void FindStates(struct lemon*); +void FindLinks(struct lemon*); +void FindFollowSets(struct lemon*); +void FindActions(struct lemon*); + +/********* From the file "configlist.h" *********************************/ +void Configlist_init(void); +struct config *Configlist_add(struct rule *, int); +struct config *Configlist_addbasis(struct rule *, int); +void Configlist_closure(struct lemon *); +void Configlist_sort(void); +void Configlist_sortbasis(void); +struct config *Configlist_return(void); +struct config *Configlist_basis(void); +void Configlist_eat(struct config *); +void Configlist_reset(void); + +/********* From the file "error.h" ***************************************/ +void ErrorMsg(const char *, int,const char *, ...); + +/****** From the file "option.h" ******************************************/ +enum option_type { OPT_FLAG=1, OPT_INT, OPT_DBL, OPT_STR, + OPT_FFLAG, OPT_FINT, OPT_FDBL, OPT_FSTR}; +struct s_options { + enum option_type type; + const char *label; + char *arg; + const char *message; +}; +int OptInit(char**,struct s_options*,FILE*); +int OptNArgs(void); +char *OptArg(int); +void OptErr(int); +void OptPrint(void); + +/******** From the file "parse.h" *****************************************/ +void Parse(struct lemon *lemp); + +/********* From the file "plink.h" ***************************************/ +struct plink *Plink_new(void); +void Plink_add(struct plink **, struct config *); +void Plink_copy(struct plink **, struct plink *); +void Plink_delete(struct plink *); + +/********** From the file "report.h" *************************************/ +void Reprint(struct lemon *); +void ReportOutput(struct lemon *); +void ReportTable(struct lemon *, int, int); +void ReportHeader(struct lemon *); +void CompressTables(struct lemon *); +void ResortStates(struct lemon *); + +/********** From the file "set.h" ****************************************/ +void SetSize(int); /* All sets will be of size N */ +char *SetNew(void); /* A new set for element 0..N */ +void SetFree(char*); /* Deallocate a set */ +int SetAdd(char*,int); /* Add element to a set */ +int SetUnion(char *,char *); /* A <- A U B, thru element N */ +#define SetFind(X,Y) (X[Y]) /* True if Y is in set X */ + +/********** From the file "struct.h" *************************************/ +/* +** Principal data structures for the LEMON parser generator. +*/ + +typedef enum {LEMON_FALSE=0, LEMON_TRUE} Boolean; + +/* Symbols (terminals and nonterminals) of the grammar are stored +** in the following: */ +enum symbol_type { + TERMINAL, + NONTERMINAL, + MULTITERMINAL +}; +enum e_assoc { + LEFT, + RIGHT, + NONE, + UNK +}; +struct symbol { + const char *name; /* Name of the symbol */ + int index; /* Index number for this symbol */ + enum symbol_type type; /* Symbols are all either TERMINALS or NTs */ + struct rule *rule; /* Linked list of rules of this (if an NT) */ + struct symbol *fallback; /* fallback token in case this token doesn't parse */ + int prec; /* Precedence if defined (-1 otherwise) */ + enum e_assoc assoc; /* Associativity if precedence is defined */ + char *firstset; /* First-set for all rules of this symbol */ + Boolean lambda; /* True if NT and can generate an empty string */ + int useCnt; /* Number of times used */ + char *destructor; /* Code which executes whenever this symbol is + ** popped from the stack during error processing */ + int destLineno; /* Line number for start of destructor. Set to + ** -1 for duplicate destructors. */ + char *datatype; /* The data type of information held by this + ** object. Only used if type==NONTERMINAL */ + int dtnum; /* The data type number. In the parser, the value + ** stack is a union. The .yy%d element of this + ** union is the correct data type for this object */ + int bContent; /* True if this symbol ever carries content - if + ** it is ever more than just syntax */ + /* The following fields are used by MULTITERMINALs only */ + int nsubsym; /* Number of constituent symbols in the MULTI */ + struct symbol **subsym; /* Array of constituent symbols */ +}; + +/* Each production rule in the grammar is stored in the following +** structure. */ +struct rule { + struct symbol *lhs; /* Left-hand side of the rule */ + const char *lhsalias; /* Alias for the LHS (NULL if none) */ + int lhsStart; /* True if left-hand side is the start symbol */ + int ruleline; /* Line number for the rule */ + int nrhs; /* Number of RHS symbols */ + struct symbol **rhs; /* The RHS symbols */ + const char **rhsalias; /* An alias for each RHS symbol (NULL if none) */ + int line; /* Line number at which code begins */ + const char *code; /* The code executed when this rule is reduced */ + const char *codePrefix; /* Setup code before code[] above */ + const char *codeSuffix; /* Breakdown code after code[] above */ + struct symbol *precsym; /* Precedence symbol for this rule */ + int index; /* An index number for this rule */ + int iRule; /* Rule number as used in the generated tables */ + Boolean noCode; /* True if this rule has no associated C code */ + Boolean codeEmitted; /* True if the code has been emitted already */ + Boolean canReduce; /* True if this rule is ever reduced */ + Boolean doesReduce; /* Reduce actions occur after optimization */ + Boolean neverReduce; /* Reduce is theoretically possible, but prevented + ** by actions or other outside implementation */ + struct rule *nextlhs; /* Next rule with the same LHS */ + struct rule *next; /* Next rule in the global list */ +}; + +/* A configuration is a production rule of the grammar together with +** a mark (dot) showing how much of that rule has been processed so far. +** Configurations also contain a follow-set which is a list of terminal +** symbols which are allowed to immediately follow the end of the rule. +** Every configuration is recorded as an instance of the following: */ +enum cfgstatus { + COMPLETE, + INCOMPLETE +}; +struct config { + struct rule *rp; /* The rule upon which the configuration is based */ + int dot; /* The parse point */ + char *fws; /* Follow-set for this configuration only */ + struct plink *fplp; /* Follow-set forward propagation links */ + struct plink *bplp; /* Follow-set backwards propagation links */ + struct state *stp; /* Pointer to state which contains this */ + enum cfgstatus status; /* used during followset and shift computations */ + struct config *next; /* Next configuration in the state */ + struct config *bp; /* The next basis configuration */ +}; + +enum e_action { + SHIFT, + ACCEPT, + REDUCE, + ERROR, + SSCONFLICT, /* A shift/shift conflict */ + SRCONFLICT, /* Was a reduce, but part of a conflict */ + RRCONFLICT, /* Was a reduce, but part of a conflict */ + SH_RESOLVED, /* Was a shift. Precedence resolved conflict */ + RD_RESOLVED, /* Was reduce. Precedence resolved conflict */ + NOT_USED, /* Deleted by compression */ + SHIFTREDUCE /* Shift first, then reduce */ +}; + +/* Every shift or reduce operation is stored as one of the following */ +struct action { + struct symbol *sp; /* The look-ahead symbol */ + enum e_action type; + union { + struct state *stp; /* The new state, if a shift */ + struct rule *rp; /* The rule, if a reduce */ + } x; + struct symbol *spOpt; /* SHIFTREDUCE optimization to this symbol */ + struct action *next; /* Next action for this state */ + struct action *collide; /* Next action with the same hash */ +}; + +/* Each state of the generated parser's finite state machine +** is encoded as an instance of the following structure. */ +struct state { + struct config *bp; /* The basis configurations for this state */ + struct config *cfp; /* All configurations in this set */ + int statenum; /* Sequential number for this state */ + struct action *ap; /* List of actions for this state */ + int nTknAct, nNtAct; /* Number of actions on terminals and nonterminals */ + int iTknOfst, iNtOfst; /* yy_action[] offset for terminals and nonterms */ + int iDfltReduce; /* Default action is to REDUCE by this rule */ + struct rule *pDfltReduce;/* The default REDUCE rule. */ + int autoReduce; /* True if this is an auto-reduce state */ +}; +#define NO_OFFSET (-2147483647) + +/* A followset propagation link indicates that the contents of one +** configuration followset should be propagated to another whenever +** the first changes. */ +struct plink { + struct config *cfp; /* The configuration to which linked */ + struct plink *next; /* The next propagate link */ +}; + +/* The state vector for the entire parser generator is recorded as +** follows. (LEMON uses no global variables and makes little use of +** static variables. Fields in the following structure can be thought +** of as begin global variables in the program.) */ +struct lemon { + struct state **sorted; /* Table of states sorted by state number */ + struct rule *rule; /* List of all rules */ + struct rule *startRule; /* First rule */ + int nstate; /* Number of states */ + int nxstate; /* nstate with tail degenerate states removed */ + int nrule; /* Number of rules */ + int nruleWithAction; /* Number of rules with actions */ + int nsymbol; /* Number of terminal and nonterminal symbols */ + int nterminal; /* Number of terminal symbols */ + int minShiftReduce; /* Minimum shift-reduce action value */ + int errAction; /* Error action value */ + int accAction; /* Accept action value */ + int noAction; /* No-op action value */ + int minReduce; /* Minimum reduce action */ + int maxAction; /* Maximum action value of any kind */ + struct symbol **symbols; /* Sorted array of pointers to symbols */ + int errorcnt; /* Number of errors */ + struct symbol *errsym; /* The error symbol */ + struct symbol *wildcard; /* Token that matches anything */ + char *name; /* Name of the generated parser */ + char *arg; /* Declaration of the 3rd argument to parser */ + char *ctx; /* Declaration of 2nd argument to constructor */ + char *tokentype; /* Type of terminal symbols in the parser stack */ + char *vartype; /* The default type of non-terminal symbols */ + char *start; /* Name of the start symbol for the grammar */ + char *stacksize; /* Size of the parser stack */ + char *include; /* Code to put at the start of the C file */ + char *error; /* Code to execute when an error is seen */ + char *overflow; /* Code to execute on a stack overflow */ + char *failure; /* Code to execute on parser failure */ + char *accept; /* Code to execute when the parser excepts */ + char *extracode; /* Code appended to the generated file */ + char *tokendest; /* Code to execute to destroy token data */ + char *vardest; /* Code for the default non-terminal destructor */ + char *filename; /* Name of the input file */ + char *outname; /* Name of the current output file */ + char *tokenprefix; /* A prefix added to token names in the .h file */ + char *reallocFunc; /* Function to use to allocate stack space */ + char *freeFunc; /* Function to use to free stack space */ + int nconflict; /* Number of parsing conflicts */ + int nactiontab; /* Number of entries in the yy_action[] table */ + int nlookaheadtab; /* Number of entries in yy_lookahead[] */ + int tablesize; /* Total table size of all tables in bytes */ + int basisflag; /* Print only basis configurations */ + int printPreprocessed; /* Show preprocessor output on stdout */ + int has_fallback; /* True if any %fallback is seen in the grammar */ + int nolinenosflag; /* True if #line statements should not be printed */ + int argc; /* Number of command-line arguments */ + char **argv; /* Command-line arguments */ +}; + +#define MemoryCheck(X) if((X)==0){ \ + extern void memory_error(); \ + memory_error(); \ +} + +/**************** From the file "table.h" *********************************/ +/* +** All code in this file has been automatically generated +** from a specification in the file +** "table.q" +** by the associative array code building program "aagen". +** Do not edit this file! Instead, edit the specification +** file, then rerun aagen. +*/ +/* +** Code for processing tables in the LEMON parser generator. +*/ +/* Routines for handling a strings */ + +const char *Strsafe(const char *); + +void Strsafe_init(void); +int Strsafe_insert(const char *); +const char *Strsafe_find(const char *); + +/* Routines for handling symbols of the grammar */ + +struct symbol *Symbol_new(const char *); +int Symbolcmpp(const void *, const void *); +void Symbol_init(void); +int Symbol_insert(struct symbol *, const char *); +struct symbol *Symbol_find(const char *); +struct symbol *Symbol_Nth(int); +int Symbol_count(void); +struct symbol **Symbol_arrayof(void); + +/* Routines to manage the state table */ + +int Configcmp(const char *, const char *); +struct state *State_new(void); +void State_init(void); +int State_insert(struct state *, struct config *); +struct state *State_find(struct config *); +struct state **State_arrayof(void); + +/* Routines used for efficiency in Configlist_add */ + +void Configtable_init(void); +int Configtable_insert(struct config *); +struct config *Configtable_find(struct config *); +void Configtable_clear(int(*)(struct config *)); + +/****************** From the file "action.c" *******************************/ +/* +** Routines processing parser actions in the LEMON parser generator. +*/ + +/* Allocate a new parser action */ +static struct action *Action_new(void){ + static struct action *actionfreelist = 0; + struct action *newaction; + + if( actionfreelist==0 ){ + int i; + int amt = 100; + actionfreelist = (struct action *)lemon_calloc(amt, sizeof(struct action)); + if( actionfreelist==0 ){ + fprintf(stderr,"Unable to allocate memory for a new parser action."); + exit(1); + } + for(i=0; inext; + return newaction; +} + +/* Compare two actions for sorting purposes. Return negative, zero, or +** positive if the first action is less than, equal to, or greater than +** the first +*/ +static int actioncmp( + struct action *ap1, + struct action *ap2 +){ + int rc; + rc = ap1->sp->index - ap2->sp->index; + if( rc==0 ){ + rc = (int)ap1->type - (int)ap2->type; + } + if( rc==0 && (ap1->type==REDUCE || ap1->type==SHIFTREDUCE) ){ + rc = ap1->x.rp->index - ap2->x.rp->index; + } + if( rc==0 ){ + rc = (int) (ap2 - ap1); + } + return rc; +} + +/* Sort parser actions */ +static struct action *Action_sort( + struct action *ap +){ + ap = (struct action *)msort((char *)ap,(char **)&ap->next, + (int(*)(const char*,const char*))actioncmp); + return ap; +} + +void Action_add( + struct action **app, + enum e_action type, + struct symbol *sp, + char *arg +){ + struct action *newaction; + newaction = Action_new(); + newaction->next = *app; + *app = newaction; + newaction->type = type; + newaction->sp = sp; + newaction->spOpt = 0; + if( type==SHIFT ){ + newaction->x.stp = (struct state *)arg; + }else{ + newaction->x.rp = (struct rule *)arg; + } +} +/********************** New code to implement the "acttab" module ***********/ +/* +** This module implements routines use to construct the yy_action[] table. +*/ + +/* +** The state of the yy_action table under construction is an instance of +** the following structure. +** +** The yy_action table maps the pair (state_number, lookahead) into an +** action_number. The table is an array of integers pairs. The state_number +** determines an initial offset into the yy_action array. The lookahead +** value is then added to this initial offset to get an index X into the +** yy_action array. If the aAction[X].lookahead equals the value of the +** of the lookahead input, then the value of the action_number output is +** aAction[X].action. If the lookaheads do not match then the +** default action for the state_number is returned. +** +** All actions associated with a single state_number are first entered +** into aLookahead[] using multiple calls to acttab_action(). Then the +** actions for that single state_number are placed into the aAction[] +** array with a single call to acttab_insert(). The acttab_insert() call +** also resets the aLookahead[] array in preparation for the next +** state number. +*/ +struct lookahead_action { + int lookahead; /* Value of the lookahead token */ + int action; /* Action to take on the given lookahead */ +}; +typedef struct acttab acttab; +struct acttab { + int nAction; /* Number of used slots in aAction[] */ + int nActionAlloc; /* Slots allocated for aAction[] */ + struct lookahead_action + *aAction, /* The yy_action[] table under construction */ + *aLookahead; /* A single new transaction set */ + int mnLookahead; /* Minimum aLookahead[].lookahead */ + int mnAction; /* Action associated with mnLookahead */ + int mxLookahead; /* Maximum aLookahead[].lookahead */ + int nLookahead; /* Used slots in aLookahead[] */ + int nLookaheadAlloc; /* Slots allocated in aLookahead[] */ + int nterminal; /* Number of terminal symbols */ + int nsymbol; /* total number of symbols */ +}; + +/* Return the number of entries in the yy_action table */ +#define acttab_lookahead_size(X) ((X)->nAction) + +/* The value for the N-th entry in yy_action */ +#define acttab_yyaction(X,N) ((X)->aAction[N].action) + +/* The value for the N-th entry in yy_lookahead */ +#define acttab_yylookahead(X,N) ((X)->aAction[N].lookahead) + +/* Free all memory associated with the given acttab */ +void acttab_free(acttab *p){ + lemon_free( p->aAction ); + lemon_free( p->aLookahead ); + lemon_free( p ); +} + +/* Allocate a new acttab structure */ +acttab *acttab_alloc(int nsymbol, int nterminal){ + acttab *p = (acttab *) lemon_calloc( 1, sizeof(*p) ); + if( p==0 ){ + fprintf(stderr,"Unable to allocate memory for a new acttab."); + exit(1); + } + memset(p, 0, sizeof(*p)); + p->nsymbol = nsymbol; + p->nterminal = nterminal; + return p; +} + +/* Add a new action to the current transaction set. +** +** This routine is called once for each lookahead for a particular +** state. +*/ +void acttab_action(acttab *p, int lookahead, int action){ + if( p->nLookahead>=p->nLookaheadAlloc ){ + p->nLookaheadAlloc += 25; + p->aLookahead = (struct lookahead_action *) lemon_realloc( p->aLookahead, + sizeof(p->aLookahead[0])*p->nLookaheadAlloc ); + if( p->aLookahead==0 ){ + fprintf(stderr,"malloc failed\n"); + exit(1); + } + } + if( p->nLookahead==0 ){ + p->mxLookahead = lookahead; + p->mnLookahead = lookahead; + p->mnAction = action; + }else{ + if( p->mxLookaheadmxLookahead = lookahead; + if( p->mnLookahead>lookahead ){ + p->mnLookahead = lookahead; + p->mnAction = action; + } + } + p->aLookahead[p->nLookahead].lookahead = lookahead; + p->aLookahead[p->nLookahead].action = action; + p->nLookahead++; +} + +/* +** Add the transaction set built up with prior calls to acttab_action() +** into the current action table. Then reset the transaction set back +** to an empty set in preparation for a new round of acttab_action() calls. +** +** Return the offset into the action table of the new transaction. +** +** If the makeItSafe parameter is true, then the offset is chosen so that +** it is impossible to overread the yy_lookaside[] table regardless of +** the lookaside token. This is done for the terminal symbols, as they +** come from external inputs and can contain syntax errors. When makeItSafe +** is false, there is more flexibility in selecting offsets, resulting in +** a smaller table. For non-terminal symbols, which are never syntax errors, +** makeItSafe can be false. +*/ +int acttab_insert(acttab *p, int makeItSafe){ + int i, j, k, n, end; + assert( p->nLookahead>0 ); + + /* Make sure we have enough space to hold the expanded action table + ** in the worst case. The worst case occurs if the transaction set + ** must be appended to the current action table + */ + n = p->nsymbol + 1; + if( p->nAction + n >= p->nActionAlloc ){ + int oldAlloc = p->nActionAlloc; + p->nActionAlloc = p->nAction + n + p->nActionAlloc + 20; + p->aAction = (struct lookahead_action *) lemon_realloc( p->aAction, + sizeof(p->aAction[0])*p->nActionAlloc); + if( p->aAction==0 ){ + fprintf(stderr,"malloc failed\n"); + exit(1); + } + for(i=oldAlloc; inActionAlloc; i++){ + p->aAction[i].lookahead = -1; + p->aAction[i].action = -1; + } + } + + /* Scan the existing action table looking for an offset that is a + ** duplicate of the current transaction set. Fall out of the loop + ** if and when the duplicate is found. + ** + ** i is the index in p->aAction[] where p->mnLookahead is inserted. + */ + end = makeItSafe ? p->mnLookahead : 0; + for(i=p->nAction-1; i>=end; i--){ + if( p->aAction[i].lookahead==p->mnLookahead ){ + /* All lookaheads and actions in the aLookahead[] transaction + ** must match against the candidate aAction[i] entry. */ + if( p->aAction[i].action!=p->mnAction ) continue; + for(j=0; jnLookahead; j++){ + k = p->aLookahead[j].lookahead - p->mnLookahead + i; + if( k<0 || k>=p->nAction ) break; + if( p->aLookahead[j].lookahead!=p->aAction[k].lookahead ) break; + if( p->aLookahead[j].action!=p->aAction[k].action ) break; + } + if( jnLookahead ) continue; + + /* No possible lookahead value that is not in the aLookahead[] + ** transaction is allowed to match aAction[i] */ + n = 0; + for(j=0; jnAction; j++){ + if( p->aAction[j].lookahead<0 ) continue; + if( p->aAction[j].lookahead==j+p->mnLookahead-i ) n++; + } + if( n==p->nLookahead ){ + break; /* An exact match is found at offset i */ + } + } + } + + /* If no existing offsets exactly match the current transaction, find an + ** an empty offset in the aAction[] table in which we can add the + ** aLookahead[] transaction. + */ + if( inAction, which means the + ** transaction will be appended. */ + i = makeItSafe ? p->mnLookahead : 0; + for(; inActionAlloc - p->mxLookahead; i++){ + if( p->aAction[i].lookahead<0 ){ + for(j=0; jnLookahead; j++){ + k = p->aLookahead[j].lookahead - p->mnLookahead + i; + if( k<0 ) break; + if( p->aAction[k].lookahead>=0 ) break; + } + if( jnLookahead ) continue; + for(j=0; jnAction; j++){ + if( p->aAction[j].lookahead==j+p->mnLookahead-i ) break; + } + if( j==p->nAction ){ + break; /* Fits in empty slots */ + } + } + } + } + /* Insert transaction set at index i. */ +#if 0 + printf("Acttab:"); + for(j=0; jnLookahead; j++){ + printf(" %d", p->aLookahead[j].lookahead); + } + printf(" inserted at %d\n", i); +#endif + for(j=0; jnLookahead; j++){ + k = p->aLookahead[j].lookahead - p->mnLookahead + i; + p->aAction[k] = p->aLookahead[j]; + if( k>=p->nAction ) p->nAction = k+1; + } + if( makeItSafe && i+p->nterminal>=p->nAction ) p->nAction = i+p->nterminal+1; + p->nLookahead = 0; + + /* Return the offset that is added to the lookahead in order to get the + ** index into yy_action of the action */ + return i - p->mnLookahead; +} + +/* +** Return the size of the action table without the trailing syntax error +** entries. +*/ +int acttab_action_size(acttab *p){ + int n = p->nAction; + while( n>0 && p->aAction[n-1].lookahead<0 ){ n--; } + return n; +} + +/********************** From the file "build.c" *****************************/ +/* +** Routines to construction the finite state machine for the LEMON +** parser generator. +*/ + +/* Find a precedence symbol of every rule in the grammar. +** +** Those rules which have a precedence symbol coded in the input +** grammar using the "[symbol]" construct will already have the +** rp->precsym field filled. Other rules take as their precedence +** symbol the first RHS symbol with a defined precedence. If there +** are not RHS symbols with a defined precedence, the precedence +** symbol field is left blank. +*/ +void FindRulePrecedences(struct lemon *xp) +{ + struct rule *rp; + for(rp=xp->rule; rp; rp=rp->next){ + if( rp->precsym==0 ){ + int i, j; + for(i=0; inrhs && rp->precsym==0; i++){ + struct symbol *sp = rp->rhs[i]; + if( sp->type==MULTITERMINAL ){ + for(j=0; jnsubsym; j++){ + if( sp->subsym[j]->prec>=0 ){ + rp->precsym = sp->subsym[j]; + break; + } + } + }else if( sp->prec>=0 ){ + rp->precsym = rp->rhs[i]; + } + } + } + } + return; +} + +/* Find all nonterminals which will generate the empty string. +** Then go back and compute the first sets of every nonterminal. +** The first set is the set of all terminal symbols which can begin +** a string generated by that nonterminal. +*/ +void FindFirstSets(struct lemon *lemp) +{ + int i, j; + struct rule *rp; + int progress; + + for(i=0; insymbol; i++){ + lemp->symbols[i]->lambda = LEMON_FALSE; + } + for(i=lemp->nterminal; insymbol; i++){ + lemp->symbols[i]->firstset = SetNew(); + } + + /* First compute all lambdas */ + do{ + progress = 0; + for(rp=lemp->rule; rp; rp=rp->next){ + if( rp->lhs->lambda ) continue; + for(i=0; inrhs; i++){ + struct symbol *sp = rp->rhs[i]; + assert( sp->type==NONTERMINAL || sp->lambda==LEMON_FALSE ); + if( sp->lambda==LEMON_FALSE ) break; + } + if( i==rp->nrhs ){ + rp->lhs->lambda = LEMON_TRUE; + progress = 1; + } + } + }while( progress ); + + /* Now compute all first sets */ + do{ + struct symbol *s1, *s2; + progress = 0; + for(rp=lemp->rule; rp; rp=rp->next){ + s1 = rp->lhs; + for(i=0; inrhs; i++){ + s2 = rp->rhs[i]; + if( s2->type==TERMINAL ){ + progress += SetAdd(s1->firstset,s2->index); + break; + }else if( s2->type==MULTITERMINAL ){ + for(j=0; jnsubsym; j++){ + progress += SetAdd(s1->firstset,s2->subsym[j]->index); + } + break; + }else if( s1==s2 ){ + if( s1->lambda==LEMON_FALSE ) break; + }else{ + progress += SetUnion(s1->firstset,s2->firstset); + if( s2->lambda==LEMON_FALSE ) break; + } + } + } + }while( progress ); + return; +} + +/* Compute all LR(0) states for the grammar. Links +** are added to between some states so that the LR(1) follow sets +** can be computed later. +*/ +PRIVATE struct state *getstate(struct lemon *); /* forward reference */ +void FindStates(struct lemon *lemp) +{ + struct symbol *sp; + struct rule *rp; + + Configlist_init(); + + /* Find the start symbol */ + if( lemp->start ){ + sp = Symbol_find(lemp->start); + if( sp==0 ){ + ErrorMsg(lemp->filename,0, + "The specified start symbol \"%s\" is not " + "in a nonterminal of the grammar. \"%s\" will be used as the start " + "symbol instead.",lemp->start,lemp->startRule->lhs->name); + lemp->errorcnt++; + sp = lemp->startRule->lhs; + } + }else if( lemp->startRule ){ + sp = lemp->startRule->lhs; + }else{ + ErrorMsg(lemp->filename,0,"Internal error - no start rule\n"); + exit(1); + } + + /* Make sure the start symbol doesn't occur on the right-hand side of + ** any rule. Report an error if it does. (YACC would generate a new + ** start symbol in this case.) */ + for(rp=lemp->rule; rp; rp=rp->next){ + int i; + for(i=0; inrhs; i++){ + if( rp->rhs[i]==sp ){ /* FIX ME: Deal with multiterminals */ + ErrorMsg(lemp->filename,0, + "The start symbol \"%s\" occurs on the " + "right-hand side of a rule. This will result in a parser which " + "does not work properly.",sp->name); + lemp->errorcnt++; + } + } + } + + /* The basis configuration set for the first state + ** is all rules which have the start symbol as their + ** left-hand side */ + for(rp=sp->rule; rp; rp=rp->nextlhs){ + struct config *newcfp; + rp->lhsStart = 1; + newcfp = Configlist_addbasis(rp,0); + SetAdd(newcfp->fws,0); + } + + /* Compute the first state. All other states will be + ** computed automatically during the computation of the first one. + ** The returned pointer to the first state is not used. */ + (void)getstate(lemp); + return; +} + +/* Return a pointer to a state which is described by the configuration +** list which has been built from calls to Configlist_add. +*/ +PRIVATE void buildshifts(struct lemon *, struct state *); /* Forwd ref */ +PRIVATE struct state *getstate(struct lemon *lemp) +{ + struct config *cfp, *bp; + struct state *stp; + + /* Extract the sorted basis of the new state. The basis was constructed + ** by prior calls to "Configlist_addbasis()". */ + Configlist_sortbasis(); + bp = Configlist_basis(); + + /* Get a state with the same basis */ + stp = State_find(bp); + if( stp ){ + /* A state with the same basis already exists! Copy all the follow-set + ** propagation links from the state under construction into the + ** preexisting state, then return a pointer to the preexisting state */ + struct config *x, *y; + for(x=bp, y=stp->bp; x && y; x=x->bp, y=y->bp){ + Plink_copy(&y->bplp,x->bplp); + Plink_delete(x->fplp); + x->fplp = x->bplp = 0; + } + cfp = Configlist_return(); + Configlist_eat(cfp); + }else{ + /* This really is a new state. Construct all the details */ + Configlist_closure(lemp); /* Compute the configuration closure */ + Configlist_sort(); /* Sort the configuration closure */ + cfp = Configlist_return(); /* Get a pointer to the config list */ + stp = State_new(); /* A new state structure */ + MemoryCheck(stp); + stp->bp = bp; /* Remember the configuration basis */ + stp->cfp = cfp; /* Remember the configuration closure */ + stp->statenum = lemp->nstate++; /* Every state gets a sequence number */ + stp->ap = 0; /* No actions, yet. */ + State_insert(stp,stp->bp); /* Add to the state table */ + buildshifts(lemp,stp); /* Recursively compute successor states */ + } + return stp; +} + +/* +** Return true if two symbols are the same. +*/ +int same_symbol(struct symbol *a, struct symbol *b) +{ + int i; + if( a==b ) return 1; + if( a->type!=MULTITERMINAL ) return 0; + if( b->type!=MULTITERMINAL ) return 0; + if( a->nsubsym!=b->nsubsym ) return 0; + for(i=0; insubsym; i++){ + if( a->subsym[i]!=b->subsym[i] ) return 0; + } + return 1; +} + +/* Construct all successor states to the given state. A "successor" +** state is any state which can be reached by a shift action. +*/ +PRIVATE void buildshifts(struct lemon *lemp, struct state *stp) +{ + struct config *cfp; /* For looping thru the config closure of "stp" */ + struct config *bcfp; /* For the inner loop on config closure of "stp" */ + struct config *newcfg; /* */ + struct symbol *sp; /* Symbol following the dot in configuration "cfp" */ + struct symbol *bsp; /* Symbol following the dot in configuration "bcfp" */ + struct state *newstp; /* A pointer to a successor state */ + + /* Each configuration becomes complete after it contributes to a successor + ** state. Initially, all configurations are incomplete */ + for(cfp=stp->cfp; cfp; cfp=cfp->next) cfp->status = INCOMPLETE; + + /* Loop through all configurations of the state "stp" */ + for(cfp=stp->cfp; cfp; cfp=cfp->next){ + if( cfp->status==COMPLETE ) continue; /* Already used by inner loop */ + if( cfp->dot>=cfp->rp->nrhs ) continue; /* Can't shift this config */ + Configlist_reset(); /* Reset the new config set */ + sp = cfp->rp->rhs[cfp->dot]; /* Symbol after the dot */ + + /* For every configuration in the state "stp" which has the symbol "sp" + ** following its dot, add the same configuration to the basis set under + ** construction but with the dot shifted one symbol to the right. */ + for(bcfp=cfp; bcfp; bcfp=bcfp->next){ + if( bcfp->status==COMPLETE ) continue; /* Already used */ + if( bcfp->dot>=bcfp->rp->nrhs ) continue; /* Can't shift this one */ + bsp = bcfp->rp->rhs[bcfp->dot]; /* Get symbol after dot */ + if( !same_symbol(bsp,sp) ) continue; /* Must be same as for "cfp" */ + bcfp->status = COMPLETE; /* Mark this config as used */ + newcfg = Configlist_addbasis(bcfp->rp,bcfp->dot+1); + Plink_add(&newcfg->bplp,bcfp); + } + + /* Get a pointer to the state described by the basis configuration set + ** constructed in the preceding loop */ + newstp = getstate(lemp); + + /* The state "newstp" is reached from the state "stp" by a shift action + ** on the symbol "sp" */ + if( sp->type==MULTITERMINAL ){ + int i; + for(i=0; insubsym; i++){ + Action_add(&stp->ap,SHIFT,sp->subsym[i],(char*)newstp); + } + }else{ + Action_add(&stp->ap,SHIFT,sp,(char *)newstp); + } + } +} + +/* +** Construct the propagation links +*/ +void FindLinks(struct lemon *lemp) +{ + int i; + struct config *cfp, *other; + struct state *stp; + struct plink *plp; + + /* Housekeeping detail: + ** Add to every propagate link a pointer back to the state to + ** which the link is attached. */ + for(i=0; instate; i++){ + stp = lemp->sorted[i]; + for(cfp=stp?stp->cfp:0; cfp; cfp=cfp->next){ + cfp->stp = stp; + } + } + + /* Convert all backlinks into forward links. Only the forward + ** links are used in the follow-set computation. */ + for(i=0; instate; i++){ + stp = lemp->sorted[i]; + for(cfp=stp?stp->cfp:0; cfp; cfp=cfp->next){ + for(plp=cfp->bplp; plp; plp=plp->next){ + other = plp->cfp; + Plink_add(&other->fplp,cfp); + } + } + } +} + +/* Compute all followsets. +** +** A followset is the set of all symbols which can come immediately +** after a configuration. +*/ +void FindFollowSets(struct lemon *lemp) +{ + int i; + struct config *cfp; + struct plink *plp; + int progress; + int change; + + for(i=0; instate; i++){ + assert( lemp->sorted[i]!=0 ); + for(cfp=lemp->sorted[i]->cfp; cfp; cfp=cfp->next){ + cfp->status = INCOMPLETE; + } + } + + do{ + progress = 0; + for(i=0; instate; i++){ + assert( lemp->sorted[i]!=0 ); + for(cfp=lemp->sorted[i]->cfp; cfp; cfp=cfp->next){ + if( cfp->status==COMPLETE ) continue; + for(plp=cfp->fplp; plp; plp=plp->next){ + change = SetUnion(plp->cfp->fws,cfp->fws); + if( change ){ + plp->cfp->status = INCOMPLETE; + progress = 1; + } + } + cfp->status = COMPLETE; + } + } + }while( progress ); +} + +static int resolve_conflict(struct action *,struct action *); + +/* Compute the reduce actions, and resolve conflicts. +*/ +void FindActions(struct lemon *lemp) +{ + int i,j; + struct config *cfp; + struct state *stp; + struct symbol *sp; + struct rule *rp; + + /* Add all of the reduce actions + ** A reduce action is added for each element of the followset of + ** a configuration which has its dot at the extreme right. + */ + for(i=0; instate; i++){ /* Loop over all states */ + stp = lemp->sorted[i]; + for(cfp=stp->cfp; cfp; cfp=cfp->next){ /* Loop over all configurations */ + if( cfp->rp->nrhs==cfp->dot ){ /* Is dot at extreme right? */ + for(j=0; jnterminal; j++){ + if( SetFind(cfp->fws,j) ){ + /* Add a reduce action to the state "stp" which will reduce by the + ** rule "cfp->rp" if the lookahead symbol is "lemp->symbols[j]" */ + Action_add(&stp->ap,REDUCE,lemp->symbols[j],(char *)cfp->rp); + } + } + } + } + } + + /* Add the accepting token */ + if( lemp->start ){ + sp = Symbol_find(lemp->start); + if( sp==0 ){ + if( lemp->startRule==0 ){ + fprintf(stderr, "internal error on source line %d: no start rule\n", + __LINE__); + exit(1); + } + sp = lemp->startRule->lhs; + } + }else{ + sp = lemp->startRule->lhs; + } + /* Add to the first state (which is always the starting state of the + ** finite state machine) an action to ACCEPT if the lookahead is the + ** start nonterminal. */ + Action_add(&lemp->sorted[0]->ap,ACCEPT,sp,0); + + /* Resolve conflicts */ + for(i=0; instate; i++){ + struct action *ap, *nap; + stp = lemp->sorted[i]; + /* assert( stp->ap ); */ + stp->ap = Action_sort(stp->ap); + for(ap=stp->ap; ap && ap->next; ap=ap->next){ + for(nap=ap->next; nap && nap->sp==ap->sp; nap=nap->next){ + /* The two actions "ap" and "nap" have the same lookahead. + ** Figure out which one should be used */ + lemp->nconflict += resolve_conflict(ap,nap); + } + } + } + + /* Report an error for each rule that can never be reduced. */ + for(rp=lemp->rule; rp; rp=rp->next) rp->canReduce = LEMON_FALSE; + for(i=0; instate; i++){ + struct action *ap; + for(ap=lemp->sorted[i]->ap; ap; ap=ap->next){ + if( ap->type==REDUCE ) ap->x.rp->canReduce = LEMON_TRUE; + } + } + for(rp=lemp->rule; rp; rp=rp->next){ + if( rp->canReduce ) continue; + ErrorMsg(lemp->filename,rp->ruleline,"This rule can not be reduced.\n"); + lemp->errorcnt++; + } +} + +/* Resolve a conflict between the two given actions. If the +** conflict can't be resolved, return non-zero. +** +** NO LONGER TRUE: +** To resolve a conflict, first look to see if either action +** is on an error rule. In that case, take the action which +** is not associated with the error rule. If neither or both +** actions are associated with an error rule, then try to +** use precedence to resolve the conflict. +** +** If either action is a SHIFT, then it must be apx. This +** function won't work if apx->type==REDUCE and apy->type==SHIFT. +*/ +static int resolve_conflict( + struct action *apx, + struct action *apy +){ + struct symbol *spx, *spy; + int errcnt = 0; + assert( apx->sp==apy->sp ); /* Otherwise there would be no conflict */ + if( apx->type==SHIFT && apy->type==SHIFT ){ + apy->type = SSCONFLICT; + errcnt++; + } + if( apx->type==SHIFT && apy->type==REDUCE ){ + spx = apx->sp; + spy = apy->x.rp->precsym; + if( spy==0 || spx->prec<0 || spy->prec<0 ){ + /* Not enough precedence information. */ + apy->type = SRCONFLICT; + errcnt++; + }else if( spx->prec>spy->prec ){ /* higher precedence wins */ + apy->type = RD_RESOLVED; + }else if( spx->precprec ){ + apx->type = SH_RESOLVED; + }else if( spx->prec==spy->prec && spx->assoc==RIGHT ){ /* Use operator */ + apy->type = RD_RESOLVED; /* associativity */ + }else if( spx->prec==spy->prec && spx->assoc==LEFT ){ /* to break tie */ + apx->type = SH_RESOLVED; + }else{ + assert( spx->prec==spy->prec && spx->assoc==NONE ); + apx->type = ERROR; + } + }else if( apx->type==REDUCE && apy->type==REDUCE ){ + spx = apx->x.rp->precsym; + spy = apy->x.rp->precsym; + if( spx==0 || spy==0 || spx->prec<0 || + spy->prec<0 || spx->prec==spy->prec ){ + apy->type = RRCONFLICT; + errcnt++; + }else if( spx->prec>spy->prec ){ + apy->type = RD_RESOLVED; + }else if( spx->precprec ){ + apx->type = RD_RESOLVED; + } + }else{ + assert( + apx->type==SH_RESOLVED || + apx->type==RD_RESOLVED || + apx->type==SSCONFLICT || + apx->type==SRCONFLICT || + apx->type==RRCONFLICT || + apy->type==SH_RESOLVED || + apy->type==RD_RESOLVED || + apy->type==SSCONFLICT || + apy->type==SRCONFLICT || + apy->type==RRCONFLICT + ); + /* The REDUCE/SHIFT case cannot happen because SHIFTs come before + ** REDUCEs on the list. If we reach this point it must be because + ** the parser conflict had already been resolved. */ + } + return errcnt; +} +/********************* From the file "configlist.c" *************************/ +/* +** Routines to processing a configuration list and building a state +** in the LEMON parser generator. +*/ + +static struct config *freelist = 0; /* List of free configurations */ +static struct config *current = 0; /* Top of list of configurations */ +static struct config **currentend = 0; /* Last on list of configs */ +static struct config *basis = 0; /* Top of list of basis configs */ +static struct config **basisend = 0; /* End of list of basis configs */ + +/* Return a pointer to a new configuration */ +PRIVATE struct config *newconfig(void){ + return (struct config*)lemon_calloc(1, sizeof(struct config)); +} + +/* The configuration "old" is no longer used */ +PRIVATE void deleteconfig(struct config *old) +{ + old->next = freelist; + freelist = old; +} + +/* Initialized the configuration list builder */ +void Configlist_init(void){ + current = 0; + currentend = ¤t; + basis = 0; + basisend = &basis; + Configtable_init(); + return; +} + +/* Initialized the configuration list builder */ +void Configlist_reset(void){ + current = 0; + currentend = ¤t; + basis = 0; + basisend = &basis; + Configtable_clear(0); + return; +} + +/* Add another configuration to the configuration list */ +struct config *Configlist_add( + struct rule *rp, /* The rule */ + int dot /* Index into the RHS of the rule where the dot goes */ +){ + struct config *cfp, model; + + assert( currentend!=0 ); + model.rp = rp; + model.dot = dot; + cfp = Configtable_find(&model); + if( cfp==0 ){ + cfp = newconfig(); + cfp->rp = rp; + cfp->dot = dot; + cfp->fws = SetNew(); + cfp->stp = 0; + cfp->fplp = cfp->bplp = 0; + cfp->next = 0; + cfp->bp = 0; + *currentend = cfp; + currentend = &cfp->next; + Configtable_insert(cfp); + } + return cfp; +} + +/* Add a basis configuration to the configuration list */ +struct config *Configlist_addbasis(struct rule *rp, int dot) +{ + struct config *cfp, model; + + assert( basisend!=0 ); + assert( currentend!=0 ); + model.rp = rp; + model.dot = dot; + cfp = Configtable_find(&model); + if( cfp==0 ){ + cfp = newconfig(); + cfp->rp = rp; + cfp->dot = dot; + cfp->fws = SetNew(); + cfp->stp = 0; + cfp->fplp = cfp->bplp = 0; + cfp->next = 0; + cfp->bp = 0; + *currentend = cfp; + currentend = &cfp->next; + *basisend = cfp; + basisend = &cfp->bp; + Configtable_insert(cfp); + } + return cfp; +} + +/* Compute the closure of the configuration list */ +void Configlist_closure(struct lemon *lemp) +{ + struct config *cfp, *newcfp; + struct rule *rp, *newrp; + struct symbol *sp, *xsp; + int i, dot; + + assert( currentend!=0 ); + for(cfp=current; cfp; cfp=cfp->next){ + rp = cfp->rp; + dot = cfp->dot; + if( dot>=rp->nrhs ) continue; + sp = rp->rhs[dot]; + if( sp->type==NONTERMINAL ){ + if( sp->rule==0 && sp!=lemp->errsym ){ + ErrorMsg(lemp->filename,rp->line,"Nonterminal \"%s\" has no rules.", + sp->name); + lemp->errorcnt++; + } + for(newrp=sp->rule; newrp; newrp=newrp->nextlhs){ + newcfp = Configlist_add(newrp,0); + for(i=dot+1; inrhs; i++){ + xsp = rp->rhs[i]; + if( xsp->type==TERMINAL ){ + SetAdd(newcfp->fws,xsp->index); + break; + }else if( xsp->type==MULTITERMINAL ){ + int k; + for(k=0; knsubsym; k++){ + SetAdd(newcfp->fws, xsp->subsym[k]->index); + } + break; + }else{ + SetUnion(newcfp->fws,xsp->firstset); + if( xsp->lambda==LEMON_FALSE ) break; + } + } + if( i==rp->nrhs ) Plink_add(&cfp->fplp,newcfp); + } + } + } + return; +} + +/* Sort the configuration list */ +void Configlist_sort(void){ + current = (struct config*)msort((char*)current,(char**)&(current->next), + Configcmp); + currentend = 0; + return; +} + +/* Sort the basis configuration list */ +void Configlist_sortbasis(void){ + basis = (struct config*)msort((char*)current,(char**)&(current->bp), + Configcmp); + basisend = 0; + return; +} + +/* Return a pointer to the head of the configuration list and +** reset the list */ +struct config *Configlist_return(void){ + struct config *old; + old = current; + current = 0; + currentend = 0; + return old; +} + +/* Return a pointer to the head of the configuration list and +** reset the list */ +struct config *Configlist_basis(void){ + struct config *old; + old = basis; + basis = 0; + basisend = 0; + return old; +} + +/* Free all elements of the given configuration list */ +void Configlist_eat(struct config *cfp) +{ + struct config *nextcfp; + for(; cfp; cfp=nextcfp){ + nextcfp = cfp->next; + assert( cfp->fplp==0 ); + assert( cfp->bplp==0 ); + if( cfp->fws ) SetFree(cfp->fws); + deleteconfig(cfp); + } + return; +} +/***************** From the file "error.c" *********************************/ +/* +** Code for printing error message. +*/ + +void ErrorMsg(const char *filename, int lineno, const char *format, ...){ + va_list ap; + fprintf(stderr, "%s:%d: ", filename, lineno); + va_start(ap, format); + vfprintf(stderr,format,ap); + va_end(ap); + fprintf(stderr, "\n"); +} +/**************** From the file "main.c" ************************************/ +/* +** Main program file for the LEMON parser generator. +*/ + +/* Report an out-of-memory condition and abort. This function +** is used mostly by the "MemoryCheck" macro in struct.h +*/ +void memory_error(void){ + fprintf(stderr,"Out of memory. Aborting...\n"); + exit(1); +} + +static int nDefine = 0; /* Number of -D options on the command line */ +static int nDefineUsed = 0; /* Number of -D options actually used */ +static char **azDefine = 0; /* Name of the -D macros */ +static char *bDefineUsed = 0; /* True for every -D macro actually used */ + +/* This routine is called with the argument to each -D command-line option. +** Add the macro defined to the azDefine array. +*/ +static void handle_D_option(char *z){ + char **paz; + nDefine++; + azDefine = (char **) lemon_realloc(azDefine, sizeof(azDefine[0])*nDefine); + if( azDefine==0 ){ + fprintf(stderr,"out of memory\n"); + exit(1); + } + bDefineUsed = (char*)lemon_realloc(bDefineUsed, nDefine); + if( bDefineUsed==0 ){ + fprintf(stderr,"out of memory\n"); + exit(1); + } + bDefineUsed[nDefine-1] = 0; + paz = &azDefine[nDefine-1]; + *paz = (char *) lemon_malloc( lemonStrlen(z)+1 ); + if( *paz==0 ){ + fprintf(stderr,"out of memory\n"); + exit(1); + } + lemon_strcpy(*paz, z); + for(z=*paz; *z && *z!='='; z++){} + *z = 0; +} + +/* Rember the name of the output directory +*/ +static char *outputDir = NULL; +static void handle_d_option(char *z){ + outputDir = (char *) lemon_malloc( lemonStrlen(z)+1 ); + if( outputDir==0 ){ + fprintf(stderr,"out of memory\n"); + exit(1); + } + lemon_strcpy(outputDir, z); +} + +static char *user_templatename = NULL; +static void handle_T_option(char *z){ + user_templatename = (char *) lemon_malloc( lemonStrlen(z)+1 ); + if( user_templatename==0 ){ + memory_error(); + } + lemon_strcpy(user_templatename, z); +} + +/* Merge together to lists of rules ordered by rule.iRule */ +static struct rule *Rule_merge(struct rule *pA, struct rule *pB){ + struct rule *pFirst = 0; + struct rule **ppPrev = &pFirst; + while( pA && pB ){ + if( pA->iRuleiRule ){ + *ppPrev = pA; + ppPrev = &pA->next; + pA = pA->next; + }else{ + *ppPrev = pB; + ppPrev = &pB->next; + pB = pB->next; + } + } + if( pA ){ + *ppPrev = pA; + }else{ + *ppPrev = pB; + } + return pFirst; +} + +/* +** Sort a list of rules in order of increasing iRule value +*/ +static struct rule *Rule_sort(struct rule *rp){ + unsigned int i; + struct rule *pNext; + struct rule *x[32]; + memset(x, 0, sizeof(x)); + while( rp ){ + pNext = rp->next; + rp->next = 0; + for(i=0; iindex = i; + qsort(lem.symbols,lem.nsymbol,sizeof(struct symbol*), Symbolcmpp); + for(i=0; iindex = i; + while( lem.symbols[i-1]->type==MULTITERMINAL ){ i--; } + assert( strcmp(lem.symbols[i-1]->name,"{default}")==0 ); + lem.nsymbol = i - 1; + for(i=1; ISUPPER(lem.symbols[i]->name[0]); i++); + lem.nterminal = i; + + /* Assign sequential rule numbers. Start with 0. Put rules that have no + ** reduce action C-code associated with them last, so that the switch() + ** statement that selects reduction actions will have a smaller jump table. + */ + for(i=0, rp=lem.rule; rp; rp=rp->next){ + rp->iRule = rp->code ? i++ : -1; + } + lem.nruleWithAction = i; + for(rp=lem.rule; rp; rp=rp->next){ + if( rp->iRule<0 ) rp->iRule = i++; + } + lem.startRule = lem.rule; + lem.rule = Rule_sort(lem.rule); + + /* Generate a reprint of the grammar, if requested on the command line */ + if( rpflag ){ + Reprint(&lem); + }else{ + /* Initialize the size for all follow and first sets */ + SetSize(lem.nterminal+1); + + /* Find the precedence for every production rule (that has one) */ + FindRulePrecedences(&lem); + + /* Compute the lambda-nonterminals and the first-sets for every + ** nonterminal */ + FindFirstSets(&lem); + + /* Compute all LR(0) states. Also record follow-set propagation + ** links so that the follow-set can be computed later */ + lem.nstate = 0; + FindStates(&lem); + lem.sorted = State_arrayof(); + + /* Tie up loose ends on the propagation links */ + FindLinks(&lem); + + /* Compute the follow set of every reducible configuration */ + FindFollowSets(&lem); + + /* Compute the action tables */ + FindActions(&lem); + + /* Compress the action tables */ + if( compress==0 ) CompressTables(&lem); + + /* Reorder and renumber the states so that states with fewer choices + ** occur at the end. This is an optimization that helps make the + ** generated parser tables smaller. */ + if( noResort==0 ) ResortStates(&lem); + + /* Generate a report of the parser generated. (the "y.output" file) */ + if( !quiet ) ReportOutput(&lem); + + /* Generate the source code for the parser */ + ReportTable(&lem, mhflag, sqlFlag); + + /* Produce a header file for use by the scanner. (This step is + ** omitted if the "-m" option is used because makeheaders will + ** generate the file for us.) */ + if( !mhflag ) ReportHeader(&lem); + } + if( statistics ){ + printf("Parser statistics:\n"); + stats_line("terminal symbols", lem.nterminal); + stats_line("non-terminal symbols", lem.nsymbol - lem.nterminal); + stats_line("total symbols", lem.nsymbol); + stats_line("rules", lem.nrule); + stats_line("states", lem.nxstate); + stats_line("conflicts", lem.nconflict); + stats_line("action table entries", lem.nactiontab); + stats_line("lookahead table entries", lem.nlookaheadtab); + stats_line("total table size (bytes)", lem.tablesize); + } + if( lem.nconflict > 0 ){ + fprintf(stderr,"%d parsing conflicts.\n",lem.nconflict); + } + + /* return 0 on success, 1 on failure. */ + exitcode = ((lem.errorcnt > 0) || (lem.nconflict > 0)) ? 1 : 0; + lemon_free_all(); + exit(exitcode); + return (exitcode); +} +/******************** From the file "msort.c" *******************************/ +/* +** A generic merge-sort program. +** +** USAGE: +** Let "ptr" be a pointer to some structure which is at the head of +** a null-terminated list. Then to sort the list call: +** +** ptr = msort(ptr,&(ptr->next),cmpfnc); +** +** In the above, "cmpfnc" is a pointer to a function which compares +** two instances of the structure and returns an integer, as in +** strcmp. The second argument is a pointer to the pointer to the +** second element of the linked list. This address is used to compute +** the offset to the "next" field within the structure. The offset to +** the "next" field must be constant for all structures in the list. +** +** The function returns a new pointer which is the head of the list +** after sorting. +** +** ALGORITHM: +** Merge-sort. +*/ + +/* +** Return a pointer to the next structure in the linked list. +*/ +#define NEXT(A) (*(char**)(((char*)A)+offset)) + +/* +** Inputs: +** a: A sorted, null-terminated linked list. (May be null). +** b: A sorted, null-terminated linked list. (May be null). +** cmp: A pointer to the comparison function. +** offset: Offset in the structure to the "next" field. +** +** Return Value: +** A pointer to the head of a sorted list containing the elements +** of both a and b. +** +** Side effects: +** The "next" pointers for elements in the lists a and b are +** changed. +*/ +static char *merge( + char *a, + char *b, + int (*cmp)(const char*,const char*), + int offset +){ + char *ptr, *head; + + if( a==0 ){ + head = b; + }else if( b==0 ){ + head = a; + }else{ + if( (*cmp)(a,b)<=0 ){ + ptr = a; + a = NEXT(a); + }else{ + ptr = b; + b = NEXT(b); + } + head = ptr; + while( a && b ){ + if( (*cmp)(a,b)<=0 ){ + NEXT(ptr) = a; + ptr = a; + a = NEXT(a); + }else{ + NEXT(ptr) = b; + ptr = b; + b = NEXT(b); + } + } + if( a ) NEXT(ptr) = a; + else NEXT(ptr) = b; + } + return head; +} + +/* +** Inputs: +** list: Pointer to a singly-linked list of structures. +** next: Pointer to pointer to the second element of the list. +** cmp: A comparison function. +** +** Return Value: +** A pointer to the head of a sorted list containing the elements +** originally in list. +** +** Side effects: +** The "next" pointers for elements in list are changed. +*/ +#define LISTSIZE 30 +static char *msort( + char *list, + char **next, + int (*cmp)(const char*,const char*) +){ + unsigned long offset; + char *ep; + char *set[LISTSIZE]; + int i; + offset = (unsigned long)((char*)next - (char*)list); + for(i=0; istate = WAITING_FOR_DECL_KEYWORD; + }else if( ISLOWER(x[0]) ){ + psp->lhs = Symbol_new(x); + psp->nrhs = 0; + psp->lhsalias = 0; + psp->state = WAITING_FOR_ARROW; + }else if( x[0]=='{' ){ + if( psp->prevrule==0 ){ + ErrorMsg(psp->filename,psp->tokenlineno, + "There is no prior rule upon which to attach the code " + "fragment which begins on this line."); + psp->errorcnt++; + }else if( psp->prevrule->code!=0 ){ + ErrorMsg(psp->filename,psp->tokenlineno, + "Code fragment beginning on this line is not the first " + "to follow the previous rule."); + psp->errorcnt++; + }else if( strcmp(x, "{NEVER-REDUCE")==0 ){ + psp->prevrule->neverReduce = 1; + }else{ + psp->prevrule->line = psp->tokenlineno; + psp->prevrule->code = &x[1]; + psp->prevrule->noCode = 0; + } + }else if( x[0]=='[' ){ + psp->state = PRECEDENCE_MARK_1; + }else{ + ErrorMsg(psp->filename,psp->tokenlineno, + "Token \"%s\" should be either \"%%\" or a nonterminal name.", + x); + psp->errorcnt++; + } + break; + case PRECEDENCE_MARK_1: + if( !ISUPPER(x[0]) ){ + ErrorMsg(psp->filename,psp->tokenlineno, + "The precedence symbol must be a terminal."); + psp->errorcnt++; + }else if( psp->prevrule==0 ){ + ErrorMsg(psp->filename,psp->tokenlineno, + "There is no prior rule to assign precedence \"[%s]\".",x); + psp->errorcnt++; + }else if( psp->prevrule->precsym!=0 ){ + ErrorMsg(psp->filename,psp->tokenlineno, + "Precedence mark on this line is not the first " + "to follow the previous rule."); + psp->errorcnt++; + }else{ + psp->prevrule->precsym = Symbol_new(x); + } + psp->state = PRECEDENCE_MARK_2; + break; + case PRECEDENCE_MARK_2: + if( x[0]!=']' ){ + ErrorMsg(psp->filename,psp->tokenlineno, + "Missing \"]\" on precedence mark."); + psp->errorcnt++; + } + psp->state = WAITING_FOR_DECL_OR_RULE; + break; + case WAITING_FOR_ARROW: + if( x[0]==':' && x[1]==':' && x[2]=='=' ){ + psp->state = IN_RHS; + }else if( x[0]=='(' ){ + psp->state = LHS_ALIAS_1; + }else{ + ErrorMsg(psp->filename,psp->tokenlineno, + "Expected to see a \":\" following the LHS symbol \"%s\".", + psp->lhs->name); + psp->errorcnt++; + psp->state = RESYNC_AFTER_RULE_ERROR; + } + break; + case LHS_ALIAS_1: + if( ISALPHA(x[0]) ){ + psp->lhsalias = x; + psp->state = LHS_ALIAS_2; + }else{ + ErrorMsg(psp->filename,psp->tokenlineno, + "\"%s\" is not a valid alias for the LHS \"%s\"\n", + x,psp->lhs->name); + psp->errorcnt++; + psp->state = RESYNC_AFTER_RULE_ERROR; + } + break; + case LHS_ALIAS_2: + if( x[0]==')' ){ + psp->state = LHS_ALIAS_3; + }else{ + ErrorMsg(psp->filename,psp->tokenlineno, + "Missing \")\" following LHS alias name \"%s\".",psp->lhsalias); + psp->errorcnt++; + psp->state = RESYNC_AFTER_RULE_ERROR; + } + break; + case LHS_ALIAS_3: + if( x[0]==':' && x[1]==':' && x[2]=='=' ){ + psp->state = IN_RHS; + }else{ + ErrorMsg(psp->filename,psp->tokenlineno, + "Missing \"->\" following: \"%s(%s)\".", + psp->lhs->name,psp->lhsalias); + psp->errorcnt++; + psp->state = RESYNC_AFTER_RULE_ERROR; + } + break; + case IN_RHS: + if( x[0]=='.' ){ + struct rule *rp; + rp = (struct rule *)lemon_calloc( sizeof(struct rule) + + sizeof(struct symbol*)*psp->nrhs + sizeof(char*)*psp->nrhs, 1); + if( rp==0 ){ + ErrorMsg(psp->filename,psp->tokenlineno, + "Can't allocate enough memory for this rule."); + psp->errorcnt++; + psp->prevrule = 0; + }else{ + int i; + rp->ruleline = psp->tokenlineno; + rp->rhs = (struct symbol**)&rp[1]; + rp->rhsalias = (const char**)&(rp->rhs[psp->nrhs]); + for(i=0; inrhs; i++){ + rp->rhs[i] = psp->rhs[i]; + rp->rhsalias[i] = psp->alias[i]; + if( rp->rhsalias[i]!=0 ){ rp->rhs[i]->bContent = 1; } + } + rp->lhs = psp->lhs; + rp->lhsalias = psp->lhsalias; + rp->nrhs = psp->nrhs; + rp->code = 0; + rp->noCode = 1; + rp->precsym = 0; + rp->index = psp->gp->nrule++; + rp->nextlhs = rp->lhs->rule; + rp->lhs->rule = rp; + rp->next = 0; + if( psp->firstrule==0 ){ + psp->firstrule = psp->lastrule = rp; + }else{ + psp->lastrule->next = rp; + psp->lastrule = rp; + } + psp->prevrule = rp; + } + psp->state = WAITING_FOR_DECL_OR_RULE; + }else if( ISALPHA(x[0]) ){ + if( psp->nrhs>=MAXRHS ){ + ErrorMsg(psp->filename,psp->tokenlineno, + "Too many symbols on RHS of rule beginning at \"%s\".", + x); + psp->errorcnt++; + psp->state = RESYNC_AFTER_RULE_ERROR; + }else{ + psp->rhs[psp->nrhs] = Symbol_new(x); + psp->alias[psp->nrhs] = 0; + psp->nrhs++; + } + }else if( (x[0]=='|' || x[0]=='/') && psp->nrhs>0 && ISUPPER(x[1]) ){ + struct symbol *msp = psp->rhs[psp->nrhs-1]; + if( msp->type!=MULTITERMINAL ){ + struct symbol *origsp = msp; + msp = (struct symbol *) lemon_calloc(1,sizeof(*msp)); + memset(msp, 0, sizeof(*msp)); + msp->type = MULTITERMINAL; + msp->nsubsym = 1; + msp->subsym = (struct symbol**)lemon_calloc(1,sizeof(struct symbol*)); + msp->subsym[0] = origsp; + msp->name = origsp->name; + psp->rhs[psp->nrhs-1] = msp; + } + msp->nsubsym++; + msp->subsym = (struct symbol **) lemon_realloc(msp->subsym, + sizeof(struct symbol*)*msp->nsubsym); + msp->subsym[msp->nsubsym-1] = Symbol_new(&x[1]); + if( ISLOWER(x[1]) || ISLOWER(msp->subsym[0]->name[0]) ){ + ErrorMsg(psp->filename,psp->tokenlineno, + "Cannot form a compound containing a non-terminal"); + psp->errorcnt++; + } + }else if( x[0]=='(' && psp->nrhs>0 ){ + psp->state = RHS_ALIAS_1; + }else{ + ErrorMsg(psp->filename,psp->tokenlineno, + "Illegal character on RHS of rule: \"%s\".",x); + psp->errorcnt++; + psp->state = RESYNC_AFTER_RULE_ERROR; + } + break; + case RHS_ALIAS_1: + if( ISALPHA(x[0]) ){ + psp->alias[psp->nrhs-1] = x; + psp->state = RHS_ALIAS_2; + }else{ + ErrorMsg(psp->filename,psp->tokenlineno, + "\"%s\" is not a valid alias for the RHS symbol \"%s\"\n", + x,psp->rhs[psp->nrhs-1]->name); + psp->errorcnt++; + psp->state = RESYNC_AFTER_RULE_ERROR; + } + break; + case RHS_ALIAS_2: + if( x[0]==')' ){ + psp->state = IN_RHS; + }else{ + ErrorMsg(psp->filename,psp->tokenlineno, + "Missing \")\" following LHS alias name \"%s\".",psp->lhsalias); + psp->errorcnt++; + psp->state = RESYNC_AFTER_RULE_ERROR; + } + break; + case WAITING_FOR_DECL_KEYWORD: + if( ISALPHA(x[0]) ){ + psp->declkeyword = x; + psp->declargslot = 0; + psp->decllinenoslot = 0; + psp->insertLineMacro = 1; + psp->state = WAITING_FOR_DECL_ARG; + if( strcmp(x,"name")==0 ){ + psp->declargslot = &(psp->gp->name); + psp->insertLineMacro = 0; + }else if( strcmp(x,"include")==0 ){ + psp->declargslot = &(psp->gp->include); + }else if( strcmp(x,"code")==0 ){ + psp->declargslot = &(psp->gp->extracode); + }else if( strcmp(x,"token_destructor")==0 ){ + psp->declargslot = &psp->gp->tokendest; + }else if( strcmp(x,"default_destructor")==0 ){ + psp->declargslot = &psp->gp->vardest; + }else if( strcmp(x,"token_prefix")==0 ){ + psp->declargslot = &psp->gp->tokenprefix; + psp->insertLineMacro = 0; + }else if( strcmp(x,"syntax_error")==0 ){ + psp->declargslot = &(psp->gp->error); + }else if( strcmp(x,"parse_accept")==0 ){ + psp->declargslot = &(psp->gp->accept); + }else if( strcmp(x,"parse_failure")==0 ){ + psp->declargslot = &(psp->gp->failure); + }else if( strcmp(x,"stack_overflow")==0 ){ + psp->declargslot = &(psp->gp->overflow); + }else if( strcmp(x,"extra_argument")==0 ){ + psp->declargslot = &(psp->gp->arg); + psp->insertLineMacro = 0; + }else if( strcmp(x,"extra_context")==0 ){ + psp->declargslot = &(psp->gp->ctx); + psp->insertLineMacro = 0; + }else if( strcmp(x,"token_type")==0 ){ + psp->declargslot = &(psp->gp->tokentype); + psp->insertLineMacro = 0; + }else if( strcmp(x,"default_type")==0 ){ + psp->declargslot = &(psp->gp->vartype); + psp->insertLineMacro = 0; + }else if( strcmp(x,"realloc")==0 ){ + psp->declargslot = &(psp->gp->reallocFunc); + psp->insertLineMacro = 0; + }else if( strcmp(x,"free")==0 ){ + psp->declargslot = &(psp->gp->freeFunc); + psp->insertLineMacro = 0; + }else if( strcmp(x,"stack_size")==0 ){ + psp->declargslot = &(psp->gp->stacksize); + psp->insertLineMacro = 0; + }else if( strcmp(x,"start_symbol")==0 ){ + psp->declargslot = &(psp->gp->start); + psp->insertLineMacro = 0; + }else if( strcmp(x,"left")==0 ){ + psp->preccounter++; + psp->declassoc = LEFT; + psp->state = WAITING_FOR_PRECEDENCE_SYMBOL; + }else if( strcmp(x,"right")==0 ){ + psp->preccounter++; + psp->declassoc = RIGHT; + psp->state = WAITING_FOR_PRECEDENCE_SYMBOL; + }else if( strcmp(x,"nonassoc")==0 ){ + psp->preccounter++; + psp->declassoc = NONE; + psp->state = WAITING_FOR_PRECEDENCE_SYMBOL; + }else if( strcmp(x,"destructor")==0 ){ + psp->state = WAITING_FOR_DESTRUCTOR_SYMBOL; + }else if( strcmp(x,"type")==0 ){ + psp->state = WAITING_FOR_DATATYPE_SYMBOL; + }else if( strcmp(x,"fallback")==0 ){ + psp->fallback = 0; + psp->state = WAITING_FOR_FALLBACK_ID; + }else if( strcmp(x,"token")==0 ){ + psp->state = WAITING_FOR_TOKEN_NAME; + }else if( strcmp(x,"wildcard")==0 ){ + psp->state = WAITING_FOR_WILDCARD_ID; + }else if( strcmp(x,"token_class")==0 ){ + psp->state = WAITING_FOR_CLASS_ID; + }else{ + ErrorMsg(psp->filename,psp->tokenlineno, + "Unknown declaration keyword: \"%%%s\".",x); + psp->errorcnt++; + psp->state = RESYNC_AFTER_DECL_ERROR; + } + }else{ + ErrorMsg(psp->filename,psp->tokenlineno, + "Illegal declaration keyword: \"%s\".",x); + psp->errorcnt++; + psp->state = RESYNC_AFTER_DECL_ERROR; + } + break; + case WAITING_FOR_DESTRUCTOR_SYMBOL: + if( !ISALPHA(x[0]) ){ + ErrorMsg(psp->filename,psp->tokenlineno, + "Symbol name missing after %%destructor keyword"); + psp->errorcnt++; + psp->state = RESYNC_AFTER_DECL_ERROR; + }else{ + struct symbol *sp = Symbol_new(x); + psp->declargslot = &sp->destructor; + psp->decllinenoslot = &sp->destLineno; + psp->insertLineMacro = 1; + psp->state = WAITING_FOR_DECL_ARG; + } + break; + case WAITING_FOR_DATATYPE_SYMBOL: + if( !ISALPHA(x[0]) ){ + ErrorMsg(psp->filename,psp->tokenlineno, + "Symbol name missing after %%type keyword"); + psp->errorcnt++; + psp->state = RESYNC_AFTER_DECL_ERROR; + }else{ + struct symbol *sp = Symbol_find(x); + if((sp) && (sp->datatype)){ + ErrorMsg(psp->filename,psp->tokenlineno, + "Symbol %%type \"%s\" already defined", x); + psp->errorcnt++; + psp->state = RESYNC_AFTER_DECL_ERROR; + }else{ + if (!sp){ + sp = Symbol_new(x); + } + psp->declargslot = &sp->datatype; + psp->insertLineMacro = 0; + psp->state = WAITING_FOR_DECL_ARG; + } + } + break; + case WAITING_FOR_PRECEDENCE_SYMBOL: + if( x[0]=='.' ){ + psp->state = WAITING_FOR_DECL_OR_RULE; + }else if( ISUPPER(x[0]) ){ + struct symbol *sp; + sp = Symbol_new(x); + if( sp->prec>=0 ){ + ErrorMsg(psp->filename,psp->tokenlineno, + "Symbol \"%s\" has already be given a precedence.",x); + psp->errorcnt++; + }else{ + sp->prec = psp->preccounter; + sp->assoc = psp->declassoc; + } + }else{ + ErrorMsg(psp->filename,psp->tokenlineno, + "Can't assign a precedence to \"%s\".",x); + psp->errorcnt++; + } + break; + case WAITING_FOR_DECL_ARG: + if( x[0]=='{' || x[0]=='\"' || ISALNUM(x[0]) ){ + const char *zOld, *zNew; + char *zBuf, *z; + int nOld, n, nLine = 0, nNew, nBack; + int addLineMacro; + char zLine[50]; + zNew = x; + if( zNew[0]=='"' || zNew[0]=='{' ) zNew++; + nNew = lemonStrlen(zNew); + if( *psp->declargslot ){ + zOld = *psp->declargslot; + }else{ + zOld = ""; + } + nOld = lemonStrlen(zOld); + n = nOld + nNew + 20; + addLineMacro = !psp->gp->nolinenosflag + && psp->insertLineMacro + && psp->tokenlineno>1 + && (psp->decllinenoslot==0 || psp->decllinenoslot[0]!=0); + if( addLineMacro ){ + for(z=psp->filename, nBack=0; *z; z++){ + if( *z=='\\' ) nBack++; + } + lemon_sprintf(zLine, "#line %d ", psp->tokenlineno); + nLine = lemonStrlen(zLine); + n += nLine + lemonStrlen(psp->filename) + nBack; + } + *psp->declargslot = (char *) lemon_realloc(*psp->declargslot, n); + zBuf = *psp->declargslot + nOld; + if( addLineMacro ){ + if( nOld && zBuf[-1]!='\n' ){ + *(zBuf++) = '\n'; + } + memcpy(zBuf, zLine, nLine); + zBuf += nLine; + *(zBuf++) = '"'; + for(z=psp->filename; *z; z++){ + if( *z=='\\' ){ + *(zBuf++) = '\\'; + } + *(zBuf++) = *z; + } + *(zBuf++) = '"'; + *(zBuf++) = '\n'; + } + if( psp->decllinenoslot && psp->decllinenoslot[0]==0 ){ + psp->decllinenoslot[0] = psp->tokenlineno; + } + memcpy(zBuf, zNew, nNew); + zBuf += nNew; + *zBuf = 0; + psp->state = WAITING_FOR_DECL_OR_RULE; + }else{ + ErrorMsg(psp->filename,psp->tokenlineno, + "Illegal argument to %%%s: %s",psp->declkeyword,x); + psp->errorcnt++; + psp->state = RESYNC_AFTER_DECL_ERROR; + } + break; + case WAITING_FOR_FALLBACK_ID: + if( x[0]=='.' ){ + psp->state = WAITING_FOR_DECL_OR_RULE; + }else if( !ISUPPER(x[0]) ){ + ErrorMsg(psp->filename, psp->tokenlineno, + "%%fallback argument \"%s\" should be a token", x); + psp->errorcnt++; + }else{ + struct symbol *sp = Symbol_new(x); + if( psp->fallback==0 ){ + psp->fallback = sp; + }else if( sp->fallback ){ + ErrorMsg(psp->filename, psp->tokenlineno, + "More than one fallback assigned to token %s", x); + psp->errorcnt++; + }else{ + sp->fallback = psp->fallback; + psp->gp->has_fallback = 1; + } + } + break; + case WAITING_FOR_TOKEN_NAME: + /* Tokens do not have to be declared before use. But they can be + ** in order to control their assigned integer number. The number for + ** each token is assigned when it is first seen. So by including + ** + ** %token ONE TWO THREE. + ** + ** early in the grammar file, that assigns small consecutive values + ** to each of the tokens ONE TWO and THREE. + */ + if( x[0]=='.' ){ + psp->state = WAITING_FOR_DECL_OR_RULE; + }else if( !ISUPPER(x[0]) ){ + ErrorMsg(psp->filename, psp->tokenlineno, + "%%token argument \"%s\" should be a token", x); + psp->errorcnt++; + }else{ + (void)Symbol_new(x); + } + break; + case WAITING_FOR_WILDCARD_ID: + if( x[0]=='.' ){ + psp->state = WAITING_FOR_DECL_OR_RULE; + }else if( !ISUPPER(x[0]) ){ + ErrorMsg(psp->filename, psp->tokenlineno, + "%%wildcard argument \"%s\" should be a token", x); + psp->errorcnt++; + }else{ + struct symbol *sp = Symbol_new(x); + if( psp->gp->wildcard==0 ){ + psp->gp->wildcard = sp; + }else{ + ErrorMsg(psp->filename, psp->tokenlineno, + "Extra wildcard to token: %s", x); + psp->errorcnt++; + } + } + break; + case WAITING_FOR_CLASS_ID: + if( !ISLOWER(x[0]) ){ + ErrorMsg(psp->filename, psp->tokenlineno, + "%%token_class must be followed by an identifier: %s", x); + psp->errorcnt++; + psp->state = RESYNC_AFTER_DECL_ERROR; + }else if( Symbol_find(x) ){ + ErrorMsg(psp->filename, psp->tokenlineno, + "Symbol \"%s\" already used", x); + psp->errorcnt++; + psp->state = RESYNC_AFTER_DECL_ERROR; + }else{ + psp->tkclass = Symbol_new(x); + psp->tkclass->type = MULTITERMINAL; + psp->state = WAITING_FOR_CLASS_TOKEN; + } + break; + case WAITING_FOR_CLASS_TOKEN: + if( x[0]=='.' ){ + psp->state = WAITING_FOR_DECL_OR_RULE; + }else if( ISUPPER(x[0]) || ((x[0]=='|' || x[0]=='/') && ISUPPER(x[1])) ){ + struct symbol *msp = psp->tkclass; + msp->nsubsym++; + msp->subsym = (struct symbol **) lemon_realloc(msp->subsym, + sizeof(struct symbol*)*msp->nsubsym); + if( !ISUPPER(x[0]) ) x++; + msp->subsym[msp->nsubsym-1] = Symbol_new(x); + }else{ + ErrorMsg(psp->filename, psp->tokenlineno, + "%%token_class argument \"%s\" should be a token", x); + psp->errorcnt++; + psp->state = RESYNC_AFTER_DECL_ERROR; + } + break; + case RESYNC_AFTER_RULE_ERROR: +/* if( x[0]=='.' ) psp->state = WAITING_FOR_DECL_OR_RULE; +** break; */ + case RESYNC_AFTER_DECL_ERROR: + if( x[0]=='.' ) psp->state = WAITING_FOR_DECL_OR_RULE; + if( x[0]=='%' ) psp->state = WAITING_FOR_DECL_KEYWORD; + break; + } +} + +/* The text in the input is part of the argument to an %ifdef or %ifndef. +** Evaluate the text as a boolean expression. Return true or false. +*/ +static int eval_preprocessor_boolean(char *z, int lineno){ + int neg = 0; + int res = 0; + int okTerm = 1; + int i; + for(i=0; z[i]!=0; i++){ + if( ISSPACE(z[i]) ) continue; + if( z[i]=='!' ){ + if( !okTerm ) goto pp_syntax_error; + neg = !neg; + continue; + } + if( z[i]=='|' && z[i+1]=='|' ){ + if( okTerm ) goto pp_syntax_error; + if( res ) return 1; + i++; + okTerm = 1; + continue; + } + if( z[i]=='&' && z[i+1]=='&' ){ + if( okTerm ) goto pp_syntax_error; + if( !res ) return 0; + i++; + okTerm = 1; + continue; + } + if( z[i]=='(' ){ + int k; + int n = 1; + if( !okTerm ) goto pp_syntax_error; + for(k=i+1; z[k]; k++){ + if( z[k]==')' ){ + n--; + if( n==0 ){ + z[k] = 0; + res = eval_preprocessor_boolean(&z[i+1], -1); + z[k] = ')'; + if( res<0 ){ + i = i-res; + goto pp_syntax_error; + } + i = k; + break; + } + }else if( z[k]=='(' ){ + n++; + }else if( z[k]==0 ){ + i = k; + goto pp_syntax_error; + } + } + if( neg ){ + res = !res; + neg = 0; + } + okTerm = 0; + continue; + } + if( ISALPHA(z[i]) ){ + int j, k, n; + if( !okTerm ) goto pp_syntax_error; + for(k=i+1; ISALNUM(z[k]) || z[k]=='_'; k++){} + n = k - i; + res = 0; + for(j=0; j0 ){ + fprintf(stderr, "%%if syntax error on line %d.\n", lineno); + fprintf(stderr, " %.*s <-- syntax error here\n", i+1, z); + exit(1); + }else{ + return -(i+1); + } +} + +/* Run the preprocessor over the input file text. The global variables +** azDefine[0] through azDefine[nDefine-1] contains the names of all defined +** macros. This routine looks for "%ifdef" and "%ifndef" and "%endif" and +** comments them out. Text in between is also commented out as appropriate. +*/ +static void preprocess_input(char *z){ + int i, j, k; + int exclude = 0; + int start = 0; + int lineno = 1; + int start_lineno = 1; + for(i=0; z[i]; i++){ + if( z[i]=='\n' ) lineno++; + if( z[i]!='%' || (i>0 && z[i-1]!='\n') ) continue; + if( strncmp(&z[i],"%endif",6)==0 && ISSPACE(z[i+6]) ){ + if( exclude ){ + exclude--; + if( exclude==0 ){ + for(j=start; jfilename; + ps.errorcnt = 0; + ps.state = INITIALIZE; + + /* Begin by reading the input file */ + fp = fopen(ps.filename,"rb"); + if( fp==0 ){ + ErrorMsg(ps.filename,0,"Can't open this file for reading."); + gp->errorcnt++; + return; + } + fseek(fp,0,2); + filesize = ftell(fp); + rewind(fp); + filebuf = (char *)lemon_malloc( filesize+1 ); + if( filesize>100000000 || filebuf==0 ){ + ErrorMsg(ps.filename,0,"Input file too large."); + lemon_free(filebuf); + gp->errorcnt++; + fclose(fp); + return; + } + if( fread(filebuf,1,filesize,fp)!=filesize ){ + ErrorMsg(ps.filename,0,"Can't read in all %d bytes of this file.", + filesize); + lemon_free(filebuf); + gp->errorcnt++; + fclose(fp); + return; + } + fclose(fp); + filebuf[filesize] = 0; + + /* Make an initial pass through the file to handle %ifdef and %ifndef */ + preprocess_input(filebuf); + if( gp->printPreprocessed ){ + printf("%s\n", filebuf); + return; + } + + /* Now scan the text of the input file */ + lineno = 1; + for(cp=filebuf; (c= *cp)!=0; ){ + if( c=='\n' ) lineno++; /* Keep track of the line number */ + if( ISSPACE(c) ){ cp++; continue; } /* Skip all white space */ + if( c=='/' && cp[1]=='/' ){ /* Skip C++ style comments */ + cp+=2; + while( (c= *cp)!=0 && c!='\n' ) cp++; + continue; + } + if( c=='/' && cp[1]=='*' ){ /* Skip C style comments */ + cp+=2; + if( (*cp)=='/' ) cp++; + while( (c= *cp)!=0 && (c!='/' || cp[-1]!='*') ){ + if( c=='\n' ) lineno++; + cp++; + } + if( c ) cp++; + continue; + } + ps.tokenstart = cp; /* Mark the beginning of the token */ + ps.tokenlineno = lineno; /* Linenumber on which token begins */ + if( c=='\"' ){ /* String literals */ + cp++; + while( (c= *cp)!=0 && c!='\"' ){ + if( c=='\n' ) lineno++; + cp++; + } + if( c==0 ){ + ErrorMsg(ps.filename,startline, + "String starting on this line is not terminated before " + "the end of the file."); + ps.errorcnt++; + nextcp = cp; + }else{ + nextcp = cp+1; + } + }else if( c=='{' ){ /* A block of C code */ + int level; + cp++; + for(level=1; (c= *cp)!=0 && (level>1 || c!='}'); cp++){ + if( c=='\n' ) lineno++; + else if( c=='{' ) level++; + else if( c=='}' ) level--; + else if( c=='/' && cp[1]=='*' ){ /* Skip comments */ + int prevc; + cp = &cp[2]; + prevc = 0; + while( (c= *cp)!=0 && (c!='/' || prevc!='*') ){ + if( c=='\n' ) lineno++; + prevc = c; + cp++; + } + }else if( c=='/' && cp[1]=='/' ){ /* Skip C++ style comments too */ + cp = &cp[2]; + while( (c= *cp)!=0 && c!='\n' ) cp++; + if( c ) lineno++; + }else if( c=='\'' || c=='\"' ){ /* String a character literals */ + int startchar, prevc; + startchar = c; + prevc = 0; + for(cp++; (c= *cp)!=0 && (c!=startchar || prevc=='\\'); cp++){ + if( c=='\n' ) lineno++; + if( prevc=='\\' ) prevc = 0; + else prevc = c; + } + } + } + if( c==0 ){ + ErrorMsg(ps.filename,ps.tokenlineno, + "C code starting on this line is not terminated before " + "the end of the file."); + ps.errorcnt++; + nextcp = cp; + }else{ + nextcp = cp+1; + } + }else if( ISALNUM(c) ){ /* Identifiers */ + while( (c= *cp)!=0 && (ISALNUM(c) || c=='_') ) cp++; + nextcp = cp; + }else if( c==':' && cp[1]==':' && cp[2]=='=' ){ /* The operator "::=" */ + cp += 3; + nextcp = cp; + }else if( (c=='/' || c=='|') && ISALPHA(cp[1]) ){ + cp += 2; + while( (c = *cp)!=0 && (ISALNUM(c) || c=='_') ) cp++; + nextcp = cp; + }else{ /* All other (one character) operators */ + cp++; + nextcp = cp; + } + c = *cp; + *cp = 0; /* Null terminate the token */ + parseonetoken(&ps); /* Parse the token */ + *cp = (char)c; /* Restore the buffer */ + cp = nextcp; + } + lemon_free(filebuf); /* Release the buffer after parsing */ + gp->rule = ps.firstrule; + gp->errorcnt = ps.errorcnt; +} +/*************************** From the file "plink.c" *********************/ +/* +** Routines processing configuration follow-set propagation links +** in the LEMON parser generator. +*/ +static struct plink *plink_freelist = 0; + +/* Allocate a new plink */ +struct plink *Plink_new(void){ + struct plink *newlink; + + if( plink_freelist==0 ){ + int i; + int amt = 100; + plink_freelist = (struct plink *)lemon_calloc( amt, sizeof(struct plink) ); + if( plink_freelist==0 ){ + fprintf(stderr, + "Unable to allocate memory for a new follow-set propagation link.\n"); + exit(1); + } + for(i=0; inext; + return newlink; +} + +/* Add a plink to a plink list */ +void Plink_add(struct plink **plpp, struct config *cfp) +{ + struct plink *newlink; + newlink = Plink_new(); + newlink->next = *plpp; + *plpp = newlink; + newlink->cfp = cfp; +} + +/* Transfer every plink on the list "from" to the list "to" */ +void Plink_copy(struct plink **to, struct plink *from) +{ + struct plink *nextpl; + while( from ){ + nextpl = from->next; + from->next = *to; + *to = from; + from = nextpl; + } +} + +/* Delete every plink on the list */ +void Plink_delete(struct plink *plp) +{ + struct plink *nextpl; + + while( plp ){ + nextpl = plp->next; + plp->next = plink_freelist; + plink_freelist = plp; + plp = nextpl; + } +} +/*********************** From the file "report.c" **************************/ +/* +** Procedures for generating reports and tables in the LEMON parser generator. +*/ + +/* Generate a filename with the given suffix. +*/ +PRIVATE char *file_makename(struct lemon *lemp, const char *suffix) +{ + char *name; + char *cp; + char *filename = lemp->filename; + int sz; + + if( outputDir ){ + cp = strrchr(filename, '/'); + if( cp ) filename = cp + 1; + } + sz = lemonStrlen(filename); + sz += lemonStrlen(suffix); + if( outputDir ) sz += lemonStrlen(outputDir) + 1; + sz += 5; + name = (char*)lemon_malloc( sz ); + if( name==0 ){ + fprintf(stderr,"Can't allocate space for a filename.\n"); + exit(1); + } + name[0] = 0; + if( outputDir ){ + lemon_strcpy(name, outputDir); + lemon_strcat(name, "/"); + } + lemon_strcat(name,filename); + cp = strrchr(name,'.'); + if( cp ) *cp = 0; + lemon_strcat(name,suffix); + return name; +} + +/* Open a file with a name based on the name of the input file, +** but with a different (specified) suffix, and return a pointer +** to the stream */ +PRIVATE FILE *file_open( + struct lemon *lemp, + const char *suffix, + const char *mode +){ + FILE *fp; + + if( lemp->outname ) lemon_free(lemp->outname); + lemp->outname = file_makename(lemp, suffix); + fp = fopen(lemp->outname,mode); + if( fp==0 && *mode=='w' ){ + fprintf(stderr,"Can't open file \"%s\".\n",lemp->outname); + lemp->errorcnt++; + return 0; + } + return fp; +} + +/* Print the text of a rule +*/ +void rule_print(FILE *out, struct rule *rp){ + int i, j; + fprintf(out, "%s",rp->lhs->name); + /* if( rp->lhsalias ) fprintf(out,"(%s)",rp->lhsalias); */ + fprintf(out," ::="); + for(i=0; inrhs; i++){ + struct symbol *sp = rp->rhs[i]; + if( sp->type==MULTITERMINAL ){ + fprintf(out," %s", sp->subsym[0]->name); + for(j=1; jnsubsym; j++){ + fprintf(out,"|%s", sp->subsym[j]->name); + } + }else{ + fprintf(out," %s", sp->name); + } + /* if( rp->rhsalias[i] ) fprintf(out,"(%s)",rp->rhsalias[i]); */ + } +} + +/* Duplicate the input file without comments and without actions +** on rules */ +void Reprint(struct lemon *lemp) +{ + struct rule *rp; + struct symbol *sp; + int i, j, maxlen, len, ncolumns, skip; + printf("// Reprint of input file \"%s\".\n// Symbols:\n",lemp->filename); + maxlen = 10; + for(i=0; insymbol; i++){ + sp = lemp->symbols[i]; + len = lemonStrlen(sp->name); + if( len>maxlen ) maxlen = len; + } + ncolumns = 76/(maxlen+5); + if( ncolumns<1 ) ncolumns = 1; + skip = (lemp->nsymbol + ncolumns - 1)/ncolumns; + for(i=0; insymbol; j+=skip){ + sp = lemp->symbols[j]; + assert( sp->index==j ); + printf(" %3d %-*.*s",j,maxlen,maxlen,sp->name); + } + printf("\n"); + } + for(rp=lemp->rule; rp; rp=rp->next){ + rule_print(stdout, rp); + printf("."); + if( rp->precsym ) printf(" [%s]",rp->precsym->name); + /* if( rp->code ) printf("\n %s",rp->code); */ + printf("\n"); + } +} + +/* Print a single rule. +*/ +void RulePrint(FILE *fp, struct rule *rp, int iCursor){ + struct symbol *sp; + int i, j; + fprintf(fp,"%s ::=",rp->lhs->name); + for(i=0; i<=rp->nrhs; i++){ + if( i==iCursor ) fprintf(fp," *"); + if( i==rp->nrhs ) break; + sp = rp->rhs[i]; + if( sp->type==MULTITERMINAL ){ + fprintf(fp," %s", sp->subsym[0]->name); + for(j=1; jnsubsym; j++){ + fprintf(fp,"|%s",sp->subsym[j]->name); + } + }else{ + fprintf(fp," %s", sp->name); + } + } +} + +/* Print the rule for a configuration. +*/ +void ConfigPrint(FILE *fp, struct config *cfp){ + RulePrint(fp, cfp->rp, cfp->dot); +} + +/* #define TEST */ +#if 0 +/* Print a set */ +PRIVATE void SetPrint(out,set,lemp) +FILE *out; +char *set; +struct lemon *lemp; +{ + int i; + char *spacer; + spacer = ""; + fprintf(out,"%12s[",""); + for(i=0; interminal; i++){ + if( SetFind(set,i) ){ + fprintf(out,"%s%s",spacer,lemp->symbols[i]->name); + spacer = " "; + } + } + fprintf(out,"]\n"); +} + +/* Print a plink chain */ +PRIVATE void PlinkPrint(out,plp,tag) +FILE *out; +struct plink *plp; +char *tag; +{ + while( plp ){ + fprintf(out,"%12s%s (state %2d) ","",tag,plp->cfp->stp->statenum); + ConfigPrint(out,plp->cfp); + fprintf(out,"\n"); + plp = plp->next; + } +} +#endif + +/* Print an action to the given file descriptor. Return FALSE if +** nothing was actually printed. +*/ +int PrintAction( + struct action *ap, /* The action to print */ + FILE *fp, /* Print the action here */ + int indent /* Indent by this amount */ +){ + int result = 1; + switch( ap->type ){ + case SHIFT: { + struct state *stp = ap->x.stp; + fprintf(fp,"%*s shift %-7d",indent,ap->sp->name,stp->statenum); + break; + } + case REDUCE: { + struct rule *rp = ap->x.rp; + fprintf(fp,"%*s reduce %-7d",indent,ap->sp->name,rp->iRule); + RulePrint(fp, rp, -1); + break; + } + case SHIFTREDUCE: { + struct rule *rp = ap->x.rp; + fprintf(fp,"%*s shift-reduce %-7d",indent,ap->sp->name,rp->iRule); + RulePrint(fp, rp, -1); + break; + } + case ACCEPT: + fprintf(fp,"%*s accept",indent,ap->sp->name); + break; + case ERROR: + fprintf(fp,"%*s error",indent,ap->sp->name); + break; + case SRCONFLICT: + case RRCONFLICT: + fprintf(fp,"%*s reduce %-7d ** Parsing conflict **", + indent,ap->sp->name,ap->x.rp->iRule); + break; + case SSCONFLICT: + fprintf(fp,"%*s shift %-7d ** Parsing conflict **", + indent,ap->sp->name,ap->x.stp->statenum); + break; + case SH_RESOLVED: + if( showPrecedenceConflict ){ + fprintf(fp,"%*s shift %-7d -- dropped by precedence", + indent,ap->sp->name,ap->x.stp->statenum); + }else{ + result = 0; + } + break; + case RD_RESOLVED: + if( showPrecedenceConflict ){ + fprintf(fp,"%*s reduce %-7d -- dropped by precedence", + indent,ap->sp->name,ap->x.rp->iRule); + }else{ + result = 0; + } + break; + case NOT_USED: + result = 0; + break; + } + if( result && ap->spOpt ){ + fprintf(fp," /* because %s==%s */", ap->sp->name, ap->spOpt->name); + } + return result; +} + +/* Generate the "*.out" log file */ +void ReportOutput(struct lemon *lemp) +{ + int i, n; + struct state *stp; + struct config *cfp; + struct action *ap; + struct rule *rp; + FILE *fp; + + fp = file_open(lemp,".out","wb"); + if( fp==0 ) return; + for(i=0; inxstate; i++){ + stp = lemp->sorted[i]; + fprintf(fp,"State %d:\n",stp->statenum); + if( lemp->basisflag ) cfp=stp->bp; + else cfp=stp->cfp; + while( cfp ){ + char buf[20]; + if( cfp->dot==cfp->rp->nrhs ){ + lemon_sprintf(buf,"(%d)",cfp->rp->iRule); + fprintf(fp," %5s ",buf); + }else{ + fprintf(fp," "); + } + ConfigPrint(fp,cfp); + fprintf(fp,"\n"); +#if 0 + SetPrint(fp,cfp->fws,lemp); + PlinkPrint(fp,cfp->fplp,"To "); + PlinkPrint(fp,cfp->bplp,"From"); +#endif + if( lemp->basisflag ) cfp=cfp->bp; + else cfp=cfp->next; + } + fprintf(fp,"\n"); + for(ap=stp->ap; ap; ap=ap->next){ + if( PrintAction(ap,fp,30) ) fprintf(fp,"\n"); + } + fprintf(fp,"\n"); + } + fprintf(fp, "----------------------------------------------------\n"); + fprintf(fp, "Symbols:\n"); + fprintf(fp, "The first-set of non-terminals is shown after the name.\n\n"); + for(i=0; insymbol; i++){ + int j; + struct symbol *sp; + + sp = lemp->symbols[i]; + fprintf(fp, " %3d: %s", i, sp->name); + if( sp->type==NONTERMINAL ){ + fprintf(fp, ":"); + if( sp->lambda ){ + fprintf(fp, " "); + } + for(j=0; jnterminal; j++){ + if( sp->firstset && SetFind(sp->firstset, j) ){ + fprintf(fp, " %s", lemp->symbols[j]->name); + } + } + } + if( sp->prec>=0 ) fprintf(fp," (precedence=%d)", sp->prec); + fprintf(fp, "\n"); + } + fprintf(fp, "----------------------------------------------------\n"); + fprintf(fp, "Syntax-only Symbols:\n"); + fprintf(fp, "The following symbols never carry semantic content.\n\n"); + for(i=n=0; insymbol; i++){ + int w; + struct symbol *sp = lemp->symbols[i]; + if( sp->bContent ) continue; + w = (int)strlen(sp->name); + if( n>0 && n+w>75 ){ + fprintf(fp,"\n"); + n = 0; + } + if( n>0 ){ + fprintf(fp, " "); + n++; + } + fprintf(fp, "%s", sp->name); + n += w; + } + if( n>0 ) fprintf(fp, "\n"); + fprintf(fp, "----------------------------------------------------\n"); + fprintf(fp, "Rules:\n"); + for(rp=lemp->rule; rp; rp=rp->next){ + fprintf(fp, "%4d: ", rp->iRule); + rule_print(fp, rp); + fprintf(fp,"."); + if( rp->precsym ){ + fprintf(fp," [%s precedence=%d]", + rp->precsym->name, rp->precsym->prec); + } + fprintf(fp,"\n"); + } + fclose(fp); + return; +} + +/* Search for the file "name" which is in the same directory as +** the executable */ +PRIVATE char *pathsearch(char *argv0, char *name, int modemask) +{ + const char *pathlist; + char *pathbufptr = 0; + char *pathbuf = 0; + char *path,*cp; + char c; + +#ifdef __WIN32__ + cp = strrchr(argv0,'\\'); +#else + cp = strrchr(argv0,'/'); +#endif + if( cp ){ + c = *cp; + *cp = 0; + path = (char *)lemon_malloc( lemonStrlen(argv0) + lemonStrlen(name) + 2 ); + if( path ) lemon_sprintf(path,"%s/%s",argv0,name); + *cp = c; + }else{ + pathlist = getenv("PATH"); + if( pathlist==0 ) pathlist = ".:/bin:/usr/bin"; + pathbuf = (char *) lemon_malloc( lemonStrlen(pathlist) + 1 ); + path = (char *)lemon_malloc( lemonStrlen(pathlist)+lemonStrlen(name)+2 ); + if( (pathbuf != 0) && (path!=0) ){ + pathbufptr = pathbuf; + lemon_strcpy(pathbuf, pathlist); + while( *pathbuf ){ + cp = strchr(pathbuf,':'); + if( cp==0 ) cp = &pathbuf[lemonStrlen(pathbuf)]; + c = *cp; + *cp = 0; + lemon_sprintf(path,"%s/%s",pathbuf,name); + *cp = c; + if( c==0 ) pathbuf[0] = 0; + else pathbuf = &cp[1]; + if( access(path,modemask)==0 ) break; + } + } + lemon_free(pathbufptr); + } + return path; +} + +/* Given an action, compute the integer value for that action +** which is to be put in the action table of the generated machine. +** Return negative if no action should be generated. +*/ +PRIVATE int compute_action(struct lemon *lemp, struct action *ap) +{ + int act; + switch( ap->type ){ + case SHIFT: act = ap->x.stp->statenum; break; + case SHIFTREDUCE: { + /* Since a SHIFT is inherient after a prior REDUCE, convert any + ** SHIFTREDUCE action with a nonterminal on the LHS into a simple + ** REDUCE action: */ + if( ap->sp->index>=lemp->nterminal + && (lemp->errsym==0 || ap->sp->index!=lemp->errsym->index) + ){ + act = lemp->minReduce + ap->x.rp->iRule; + }else{ + act = lemp->minShiftReduce + ap->x.rp->iRule; + } + break; + } + case REDUCE: act = lemp->minReduce + ap->x.rp->iRule; break; + case ERROR: act = lemp->errAction; break; + case ACCEPT: act = lemp->accAction; break; + default: act = -1; break; + } + return act; +} + +#define LINESIZE 1000 +/* The next cluster of routines are for reading the template file +** and writing the results to the generated parser */ +/* The first function transfers data from "in" to "out" until +** a line is seen which begins with "%%". The line number is +** tracked. +** +** if name!=0, then any word that begin with "Parse" is changed to +** begin with *name instead. +*/ +PRIVATE void tplt_xfer(char *name, FILE *in, FILE *out, int *lineno) +{ + int i, iStart; + char line[LINESIZE]; + while( fgets(line,LINESIZE,in) && (line[0]!='%' || line[1]!='%') ){ + (*lineno)++; + iStart = 0; + if( name ){ + for(i=0; line[i]; i++){ + if( line[i]=='P' && strncmp(&line[i],"Parse",5)==0 + && (i==0 || !ISALPHA(line[i-1])) + ){ + if( i>iStart ) fprintf(out,"%.*s",i-iStart,&line[iStart]); + fprintf(out,"%s",name); + i += 4; + iStart = i+1; + } + } + } + fprintf(out,"%s",&line[iStart]); + } +} + +/* Skip forward past the header of the template file to the first "%%" +*/ +PRIVATE void tplt_skip_header(FILE *in, int *lineno) +{ + char line[LINESIZE]; + while( fgets(line,LINESIZE,in) && (line[0]!='%' || line[1]!='%') ){ + (*lineno)++; + } +} + +/* The next function finds the template file and opens it, returning +** a pointer to the opened file. */ +PRIVATE FILE *tplt_open(struct lemon *lemp) +{ + static char templatename[] = "lempar.c"; + char buf[1000]; + FILE *in; + char *tpltname; + char *toFree = 0; + char *cp; + + /* first, see if user specified a template filename on the command line. */ + if (user_templatename != 0) { + if( access(user_templatename,004)==-1 ){ + fprintf(stderr,"Can't find the parser driver template file \"%s\".\n", + user_templatename); + lemp->errorcnt++; + return 0; + } + in = fopen(user_templatename,"rb"); + if( in==0 ){ + fprintf(stderr,"Can't open the template file \"%s\".\n", + user_templatename); + lemp->errorcnt++; + return 0; + } + return in; + } + + cp = strrchr(lemp->filename,'.'); + if( cp ){ + lemon_sprintf(buf,"%.*s.lt",(int)(cp-lemp->filename),lemp->filename); + }else{ + lemon_sprintf(buf,"%s.lt",lemp->filename); + } + if( access(buf,004)==0 ){ + tpltname = buf; + }else if( access(templatename,004)==0 ){ + tpltname = templatename; + }else{ + toFree = tpltname = pathsearch(lemp->argv[0],templatename,0); + } + if( tpltname==0 ){ + fprintf(stderr,"Can't find the parser driver template file \"%s\".\n", + templatename); + lemp->errorcnt++; + return 0; + } + in = fopen(tpltname,"rb"); + if( in==0 ){ + fprintf(stderr,"Can't open the template file \"%s\".\n",tpltname); + lemp->errorcnt++; + } + lemon_free(toFree); + return in; +} + +/* Print a #line directive line to the output file. */ +PRIVATE void tplt_linedir(FILE *out, int lineno, char *filename) +{ + fprintf(out,"#line %d \"",lineno); + while( *filename ){ + if( *filename == '\\' ) putc('\\',out); + putc(*filename,out); + filename++; + } + fprintf(out,"\"\n"); +} + +/* Print a string to the file and keep the linenumber up to date */ +PRIVATE void tplt_print(FILE *out, struct lemon *lemp, char *str, int *lineno) +{ + if( str==0 ) return; + while( *str ){ + putc(*str,out); + if( *str=='\n' ) (*lineno)++; + str++; + } + if( str[-1]!='\n' ){ + putc('\n',out); + (*lineno)++; + } + if (!lemp->nolinenosflag) { + (*lineno)++; tplt_linedir(out,*lineno,lemp->outname); + } + return; +} + +/* +** The following routine emits code for the destructor for the +** symbol sp +*/ +void emit_destructor_code( + FILE *out, + struct symbol *sp, + struct lemon *lemp, + int *lineno +){ + char *cp = 0; + + if( sp->type==TERMINAL ){ + cp = lemp->tokendest; + if( cp==0 ) return; + fprintf(out,"{\n"); (*lineno)++; + }else if( sp->destructor ){ + cp = sp->destructor; + fprintf(out,"{\n"); (*lineno)++; + if( !lemp->nolinenosflag ){ + (*lineno)++; + tplt_linedir(out,sp->destLineno,lemp->filename); + } + }else if( lemp->vardest ){ + cp = lemp->vardest; + if( cp==0 ) return; + fprintf(out,"{\n"); (*lineno)++; + }else{ + assert( 0 ); /* Cannot happen */ + } + for(; *cp; cp++){ + if( *cp=='$' && cp[1]=='$' ){ + fprintf(out,"(yypminor->yy%d)",sp->dtnum); + cp++; + continue; + } + if( *cp=='\n' ) (*lineno)++; + fputc(*cp,out); + } + fprintf(out,"\n"); (*lineno)++; + if (!lemp->nolinenosflag) { + (*lineno)++; tplt_linedir(out,*lineno,lemp->outname); + } + fprintf(out,"}\n"); (*lineno)++; + return; +} + +/* +** Return TRUE (non-zero) if the given symbol has a destructor. +*/ +int has_destructor(struct symbol *sp, struct lemon *lemp) +{ + int ret; + if( sp->type==TERMINAL ){ + ret = lemp->tokendest!=0; + }else{ + ret = lemp->vardest!=0 || sp->destructor!=0; + } + return ret; +} + +/* +** Append text to a dynamically allocated string. If zText is 0 then +** reset the string to be empty again. Always return the complete text +** of the string (which is overwritten with each call). +** +** n bytes of zText are stored. If n==0 then all of zText up to the first +** \000 terminator is stored. zText can contain up to two instances of +** %d. The values of p1 and p2 are written into the first and second +** %d. +** +** If n==-1, then the previous character is overwritten. +*/ +PRIVATE char *append_str(const char *zText, int n, int p1, int p2){ + static char empty[1] = { 0 }; + static char *z = 0; + static int alloced = 0; + static int used = 0; + int c; + char zInt[40]; + if( zText==0 ){ + if( used==0 && z!=0 ) z[0] = 0; + used = 0; + return z; + } + if( n<=0 ){ + if( n<0 ){ + used += n; + assert( used>=0 ); + } + n = lemonStrlen(zText); + } + if( (int) (n+sizeof(zInt)*2+used) >= alloced ){ + alloced = n + sizeof(zInt)*2 + used + 200; + z = (char *) lemon_realloc(z, alloced); + } + if( z==0 ) return empty; + while( n-- > 0 ){ + c = *(zText++); + if( c=='%' && n>0 && zText[0]=='d' ){ + lemon_sprintf(zInt, "%d", p1); + p1 = p2; + lemon_strcpy(&z[used], zInt); + used += lemonStrlen(&z[used]); + zText++; + n--; + }else{ + z[used++] = (char)c; + } + } + z[used] = 0; + return z; +} + +/* +** Write and transform the rp->code string so that symbols are expanded. +** Populate the rp->codePrefix and rp->codeSuffix strings, as appropriate. +** +** Return 1 if the expanded code requires that "yylhsminor" local variable +** to be defined. +*/ +PRIVATE int translate_code(struct lemon *lemp, struct rule *rp){ + char *cp, *xp; + int i; + int rc = 0; /* True if yylhsminor is used */ + int dontUseRhs0 = 0; /* If true, use of left-most RHS label is illegal */ + const char *zSkip = 0; /* The zOvwrt comment within rp->code, or NULL */ + char lhsused = 0; /* True if the LHS element has been used */ + char lhsdirect; /* True if LHS writes directly into stack */ + char used[MAXRHS]; /* True for each RHS element which is used */ + char zLhs[50]; /* Convert the LHS symbol into this string */ + char zOvwrt[900]; /* Comment that to allow LHS to overwrite RHS */ + + for(i=0; inrhs; i++) used[i] = 0; + lhsused = 0; + + if( rp->code==0 ){ + static char newlinestr[2] = { '\n', '\0' }; + rp->code = newlinestr; + rp->line = rp->ruleline; + rp->noCode = 1; + }else{ + rp->noCode = 0; + } + + + if( rp->nrhs==0 ){ + /* If there are no RHS symbols, then writing directly to the LHS is ok */ + lhsdirect = 1; + }else if( rp->rhsalias[0]==0 ){ + /* The left-most RHS symbol has no value. LHS direct is ok. But + ** we have to call the destructor on the RHS symbol first. */ + lhsdirect = 1; + if( has_destructor(rp->rhs[0],lemp) ){ + append_str(0,0,0,0); + append_str(" yy_destructor(yypParser,%d,&yymsp[%d].minor);\n", 0, + rp->rhs[0]->index,1-rp->nrhs); + rp->codePrefix = Strsafe(append_str(0,0,0,0)); + rp->noCode = 0; + } + }else if( rp->lhsalias==0 ){ + /* There is no LHS value symbol. */ + lhsdirect = 1; + }else if( strcmp(rp->lhsalias,rp->rhsalias[0])==0 ){ + /* The LHS symbol and the left-most RHS symbol are the same, so + ** direct writing is allowed */ + lhsdirect = 1; + lhsused = 1; + used[0] = 1; + if( rp->lhs->dtnum!=rp->rhs[0]->dtnum ){ + ErrorMsg(lemp->filename,rp->ruleline, + "%s(%s) and %s(%s) share the same label but have " + "different datatypes.", + rp->lhs->name, rp->lhsalias, rp->rhs[0]->name, rp->rhsalias[0]); + lemp->errorcnt++; + } + }else{ + lemon_sprintf(zOvwrt, "/*%s-overwrites-%s*/", + rp->lhsalias, rp->rhsalias[0]); + zSkip = strstr(rp->code, zOvwrt); + if( zSkip!=0 ){ + /* The code contains a special comment that indicates that it is safe + ** for the LHS label to overwrite left-most RHS label. */ + lhsdirect = 1; + }else{ + lhsdirect = 0; + } + } + if( lhsdirect ){ + sprintf(zLhs, "yymsp[%d].minor.yy%d",1-rp->nrhs,rp->lhs->dtnum); + }else{ + rc = 1; + sprintf(zLhs, "yylhsminor.yy%d",rp->lhs->dtnum); + } + + append_str(0,0,0,0); + + /* This const cast is wrong but harmless, if we're careful. */ + for(cp=(char *)rp->code; *cp; cp++){ + if( cp==zSkip ){ + append_str(zOvwrt,0,0,0); + cp += lemonStrlen(zOvwrt)-1; + dontUseRhs0 = 1; + continue; + } + if( ISALPHA(*cp) && (cp==rp->code || (!ISALNUM(cp[-1]) && cp[-1]!='_')) ){ + char saved; + for(xp= &cp[1]; ISALNUM(*xp) || *xp=='_'; xp++); + saved = *xp; + *xp = 0; + if( rp->lhsalias && strcmp(cp,rp->lhsalias)==0 ){ + append_str(zLhs,0,0,0); + cp = xp; + lhsused = 1; + }else{ + for(i=0; inrhs; i++){ + if( rp->rhsalias[i] && strcmp(cp,rp->rhsalias[i])==0 ){ + if( i==0 && dontUseRhs0 ){ + ErrorMsg(lemp->filename,rp->ruleline, + "Label %s used after '%s'.", + rp->rhsalias[0], zOvwrt); + lemp->errorcnt++; + }else if( cp!=rp->code && cp[-1]=='@' ){ + /* If the argument is of the form @X then substituted + ** the token number of X, not the value of X */ + append_str("yymsp[%d].major",-1,i-rp->nrhs+1,0); + }else{ + struct symbol *sp = rp->rhs[i]; + int dtnum; + if( sp->type==MULTITERMINAL ){ + dtnum = sp->subsym[0]->dtnum; + }else{ + dtnum = sp->dtnum; + } + append_str("yymsp[%d].minor.yy%d",0,i-rp->nrhs+1, dtnum); + } + cp = xp; + used[i] = 1; + break; + } + } + } + *xp = saved; + } + append_str(cp, 1, 0, 0); + } /* End loop */ + + /* Main code generation completed */ + cp = append_str(0,0,0,0); + if( cp && cp[0] ) rp->code = Strsafe(cp); + append_str(0,0,0,0); + + /* Check to make sure the LHS has been used */ + if( rp->lhsalias && !lhsused ){ + ErrorMsg(lemp->filename,rp->ruleline, + "Label \"%s\" for \"%s(%s)\" is never used.", + rp->lhsalias,rp->lhs->name,rp->lhsalias); + lemp->errorcnt++; + } + + /* Generate destructor code for RHS minor values which are not referenced. + ** Generate error messages for unused labels and duplicate labels. + */ + for(i=0; inrhs; i++){ + if( rp->rhsalias[i] ){ + if( i>0 ){ + int j; + if( rp->lhsalias && strcmp(rp->lhsalias,rp->rhsalias[i])==0 ){ + ErrorMsg(lemp->filename,rp->ruleline, + "%s(%s) has the same label as the LHS but is not the left-most " + "symbol on the RHS.", + rp->rhs[i]->name, rp->rhsalias[i]); + lemp->errorcnt++; + } + for(j=0; jrhsalias[j] && strcmp(rp->rhsalias[j],rp->rhsalias[i])==0 ){ + ErrorMsg(lemp->filename,rp->ruleline, + "Label %s used for multiple symbols on the RHS of a rule.", + rp->rhsalias[i]); + lemp->errorcnt++; + break; + } + } + } + if( !used[i] ){ + ErrorMsg(lemp->filename,rp->ruleline, + "Label %s for \"%s(%s)\" is never used.", + rp->rhsalias[i],rp->rhs[i]->name,rp->rhsalias[i]); + lemp->errorcnt++; + } + }else if( i>0 && has_destructor(rp->rhs[i],lemp) ){ + append_str(" yy_destructor(yypParser,%d,&yymsp[%d].minor);\n", 0, + rp->rhs[i]->index,i-rp->nrhs+1); + } + } + + /* If unable to write LHS values directly into the stack, write the + ** saved LHS value now. */ + if( lhsdirect==0 ){ + append_str(" yymsp[%d].minor.yy%d = ", 0, 1-rp->nrhs, rp->lhs->dtnum); + append_str(zLhs, 0, 0, 0); + append_str(";\n", 0, 0, 0); + } + + /* Suffix code generation complete */ + cp = append_str(0,0,0,0); + if( cp && cp[0] ){ + rp->codeSuffix = Strsafe(cp); + rp->noCode = 0; + } + + return rc; +} + +/* +** Generate code which executes when the rule "rp" is reduced. Write +** the code to "out". Make sure lineno stays up-to-date. +*/ +PRIVATE void emit_code( + FILE *out, + struct rule *rp, + struct lemon *lemp, + int *lineno +){ + const char *cp; + + /* Setup code prior to the #line directive */ + if( rp->codePrefix && rp->codePrefix[0] ){ + fprintf(out, "{%s", rp->codePrefix); + for(cp=rp->codePrefix; *cp; cp++){ if( *cp=='\n' ) (*lineno)++; } + } + + /* Generate code to do the reduce action */ + if( rp->code ){ + if( !lemp->nolinenosflag ){ + (*lineno)++; + tplt_linedir(out,rp->line,lemp->filename); + } + fprintf(out,"{%s",rp->code); + for(cp=rp->code; *cp; cp++){ if( *cp=='\n' ) (*lineno)++; } + fprintf(out,"}\n"); (*lineno)++; + if( !lemp->nolinenosflag ){ + (*lineno)++; + tplt_linedir(out,*lineno,lemp->outname); + } + } + + /* Generate breakdown code that occurs after the #line directive */ + if( rp->codeSuffix && rp->codeSuffix[0] ){ + fprintf(out, "%s", rp->codeSuffix); + for(cp=rp->codeSuffix; *cp; cp++){ if( *cp=='\n' ) (*lineno)++; } + } + + if( rp->codePrefix ){ + fprintf(out, "}\n"); (*lineno)++; + } + + return; +} + +/* +** Print the definition of the union used for the parser's data stack. +** This union contains fields for every possible data type for tokens +** and nonterminals. In the process of computing and printing this +** union, also set the ".dtnum" field of every terminal and nonterminal +** symbol. +*/ +void print_stack_union( + FILE *out, /* The output stream */ + struct lemon *lemp, /* The main info structure for this parser */ + int *plineno, /* Pointer to the line number */ + int mhflag /* True if generating makeheaders output */ +){ + int lineno; /* The line number of the output */ + char **types; /* A hash table of datatypes */ + int arraysize; /* Size of the "types" array */ + int maxdtlength; /* Maximum length of any ".datatype" field. */ + char *stddt; /* Standardized name for a datatype */ + int i,j; /* Loop counters */ + unsigned hash; /* For hashing the name of a type */ + const char *name; /* Name of the parser */ + + /* Allocate and initialize types[] and allocate stddt[] */ + arraysize = lemp->nsymbol * 2; + types = (char**)lemon_calloc( arraysize, sizeof(char*) ); + if( types==0 ){ + fprintf(stderr,"Out of memory.\n"); + exit(1); + } + for(i=0; ivartype ){ + maxdtlength = lemonStrlen(lemp->vartype); + } + for(i=0; insymbol; i++){ + int len; + struct symbol *sp = lemp->symbols[i]; + if( sp->datatype==0 ) continue; + len = lemonStrlen(sp->datatype); + if( len>maxdtlength ) maxdtlength = len; + } + stddt = (char*)lemon_malloc( maxdtlength*2 + 1 ); + if( stddt==0 ){ + fprintf(stderr,"Out of memory.\n"); + exit(1); + } + + /* Build a hash table of datatypes. The ".dtnum" field of each symbol + ** is filled in with the hash index plus 1. A ".dtnum" value of 0 is + ** used for terminal symbols. If there is no %default_type defined then + ** 0 is also used as the .dtnum value for nonterminals which do not specify + ** a datatype using the %type directive. + */ + for(i=0; insymbol; i++){ + struct symbol *sp = lemp->symbols[i]; + char *cp; + if( sp==lemp->errsym ){ + sp->dtnum = arraysize+1; + continue; + } + if( sp->type!=NONTERMINAL || (sp->datatype==0 && lemp->vartype==0) ){ + sp->dtnum = 0; + continue; + } + cp = sp->datatype; + if( cp==0 ) cp = lemp->vartype; + j = 0; + while( ISSPACE(*cp) ) cp++; + while( *cp ) stddt[j++] = *cp++; + while( j>0 && ISSPACE(stddt[j-1]) ) j--; + stddt[j] = 0; + if( lemp->tokentype && strcmp(stddt, lemp->tokentype)==0 ){ + sp->dtnum = 0; + continue; + } + hash = 0; + for(j=0; stddt[j]; j++){ + hash = hash*53 + stddt[j]; + } + hash = (hash & 0x7fffffff)%arraysize; + while( types[hash] ){ + if( strcmp(types[hash],stddt)==0 ){ + sp->dtnum = hash + 1; + break; + } + hash++; + if( hash>=(unsigned)arraysize ) hash = 0; + } + if( types[hash]==0 ){ + sp->dtnum = hash + 1; + types[hash] = (char*)lemon_malloc( lemonStrlen(stddt)+1 ); + if( types[hash]==0 ){ + fprintf(stderr,"Out of memory.\n"); + exit(1); + } + lemon_strcpy(types[hash],stddt); + } + } + + /* Print out the definition of YYTOKENTYPE and YYMINORTYPE */ + name = lemp->name ? lemp->name : "Parse"; + lineno = *plineno; + if( mhflag ){ fprintf(out,"#if INTERFACE\n"); lineno++; } + fprintf(out,"#define %sTOKENTYPE %s\n",name, + lemp->tokentype?lemp->tokentype:"void*"); lineno++; + if( mhflag ){ fprintf(out,"#endif\n"); lineno++; } + fprintf(out,"typedef union {\n"); lineno++; + fprintf(out," int yyinit;\n"); lineno++; + fprintf(out," %sTOKENTYPE yy0;\n",name); lineno++; + for(i=0; ierrsym && lemp->errsym->useCnt ){ + fprintf(out," int yy%d;\n",lemp->errsym->dtnum); lineno++; + } + lemon_free(stddt); + lemon_free(types); + fprintf(out,"} YYMINORTYPE;\n"); lineno++; + *plineno = lineno; +} + +/* +** Return the name of a C datatype able to represent values between +** lwr and upr, inclusive. If pnByte!=NULL then also write the sizeof +** for that type (1, 2, or 4) into *pnByte. +*/ +static const char *minimum_size_type(int lwr, int upr, int *pnByte){ + const char *zType = "int"; + int nByte = 4; + if( lwr>=0 ){ + if( upr<=255 ){ + zType = "unsigned char"; + nByte = 1; + }else if( upr<65535 ){ + zType = "unsigned short int"; + nByte = 2; + }else{ + zType = "unsigned int"; + nByte = 4; + } + }else if( lwr>=-127 && upr<=127 ){ + zType = "signed char"; + nByte = 1; + }else if( lwr>=-32767 && upr<32767 ){ + zType = "short"; + nByte = 2; + } + if( pnByte ) *pnByte = nByte; + return zType; +} + +/* +** Each state contains a set of token transaction and a set of +** nonterminal transactions. Each of these sets makes an instance +** of the following structure. An array of these structures is used +** to order the creation of entries in the yy_action[] table. +*/ +struct axset { + struct state *stp; /* A pointer to a state */ + int isTkn; /* True to use tokens. False for non-terminals */ + int nAction; /* Number of actions */ + int iOrder; /* Original order of action sets */ +}; + +/* +** Compare to axset structures for sorting purposes +*/ +static int axset_compare(const void *a, const void *b){ + struct axset *p1 = (struct axset*)a; + struct axset *p2 = (struct axset*)b; + int c; + c = p2->nAction - p1->nAction; + if( c==0 ){ + c = p1->iOrder - p2->iOrder; + } + assert( c!=0 || p1==p2 ); + return c; +} + +/* +** Write text on "out" that describes the rule "rp". +*/ +static void writeRuleText(FILE *out, struct rule *rp){ + int j; + fprintf(out,"%s ::=", rp->lhs->name); + for(j=0; jnrhs; j++){ + struct symbol *sp = rp->rhs[j]; + if( sp->type!=MULTITERMINAL ){ + fprintf(out," %s", sp->name); + }else{ + int k; + fprintf(out," %s", sp->subsym[0]->name); + for(k=1; knsubsym; k++){ + fprintf(out,"|%s",sp->subsym[k]->name); + } + } + } +} + + +/* Generate C source code for the parser */ +void ReportTable( + struct lemon *lemp, + int mhflag, /* Output in makeheaders format if true */ + int sqlFlag /* Generate the *.sql file too */ +){ + FILE *out, *in, *sql; + int lineno; + struct state *stp; + struct action *ap; + struct rule *rp; + struct acttab *pActtab; + int i, j, n, sz, mn, mx; + int nLookAhead; + int szActionType; /* sizeof(YYACTIONTYPE) */ + int szCodeType; /* sizeof(YYCODETYPE) */ + const char *name; + int mnTknOfst, mxTknOfst; + int mnNtOfst, mxNtOfst; + struct axset *ax; + char *prefix; + + lemp->minShiftReduce = lemp->nstate; + lemp->errAction = lemp->minShiftReduce + lemp->nrule; + lemp->accAction = lemp->errAction + 1; + lemp->noAction = lemp->accAction + 1; + lemp->minReduce = lemp->noAction + 1; + lemp->maxAction = lemp->minReduce + lemp->nrule; + + in = tplt_open(lemp); + if( in==0 ) return; + out = file_open(lemp,".c","wb"); + if( out==0 ){ + fclose(in); + return; + } + if( sqlFlag==0 ){ + sql = 0; + }else{ + sql = file_open(lemp, ".sql", "wb"); + if( sql==0 ){ + fclose(in); + fclose(out); + return; + } + fprintf(sql, + "BEGIN;\n" + "CREATE TABLE symbol(\n" + " id INTEGER PRIMARY KEY,\n" + " name TEXT NOT NULL,\n" + " isTerminal BOOLEAN NOT NULL,\n" + " fallback INTEGER REFERENCES symbol" + " DEFERRABLE INITIALLY DEFERRED\n" + ");\n" + ); + for(i=0; insymbol; i++){ + fprintf(sql, + "INSERT INTO symbol(id,name,isTerminal,fallback)" + "VALUES(%d,'%s',%s", + i, lemp->symbols[i]->name, + interminal ? "TRUE" : "FALSE" + ); + if( lemp->symbols[i]->fallback ){ + fprintf(sql, ",%d);\n", lemp->symbols[i]->fallback->index); + }else{ + fprintf(sql, ",NULL);\n"); + } + } + fprintf(sql, + "CREATE TABLE rule(\n" + " ruleid INTEGER PRIMARY KEY,\n" + " lhs INTEGER REFERENCES symbol(id),\n" + " txt TEXT\n" + ");\n" + "CREATE TABLE rulerhs(\n" + " ruleid INTEGER REFERENCES rule(ruleid),\n" + " pos INTEGER,\n" + " sym INTEGER REFERENCES symbol(id)\n" + ");\n" + ); + for(i=0, rp=lemp->rule; rp; rp=rp->next, i++){ + assert( i==rp->iRule ); + fprintf(sql, + "INSERT INTO rule(ruleid,lhs,txt)VALUES(%d,%d,'", + rp->iRule, rp->lhs->index + ); + writeRuleText(sql, rp); + fprintf(sql,"');\n"); + for(j=0; jnrhs; j++){ + struct symbol *sp = rp->rhs[j]; + if( sp->type!=MULTITERMINAL ){ + fprintf(sql, + "INSERT INTO rulerhs(ruleid,pos,sym)VALUES(%d,%d,%d);\n", + i,j,sp->index + ); + }else{ + int k; + for(k=0; knsubsym; k++){ + fprintf(sql, + "INSERT INTO rulerhs(ruleid,pos,sym)VALUES(%d,%d,%d);\n", + i,j,sp->subsym[k]->index + ); + } + } + } + } + fprintf(sql, "COMMIT;\n"); + } + lineno = 1; + + fprintf(out, + "/* This file is automatically generated by Lemon from input grammar\n" + "** source file \"%s\"", lemp->filename); lineno++; + if( nDefineUsed==0 ){ + fprintf(out, ".\n*/\n"); lineno += 2; + }else{ + fprintf(out, " with these options:\n**\n"); lineno += 2; + for(i=0; iinclude==0 ) lemp->include = ""; + for(i=0; ISSPACE(lemp->include[i]); i++){ + if( lemp->include[i]=='\n' ){ + lemp->include += i+1; + i = -1; + } + } + if( lemp->include[0]=='/' ){ + tplt_skip_header(in,&lineno); + }else{ + tplt_xfer(lemp->name,in,out,&lineno); + } + + /* Generate the include code, if any */ + tplt_print(out,lemp,lemp->include,&lineno); + if( mhflag ){ + char *incName = file_makename(lemp, ".h"); + fprintf(out,"#include \"%s\"\n", incName); lineno++; + lemon_free(incName); + } + tplt_xfer(lemp->name,in,out,&lineno); + + /* Generate #defines for all tokens */ + if( lemp->tokenprefix ) prefix = lemp->tokenprefix; + else prefix = ""; + if( mhflag ){ + fprintf(out,"#if INTERFACE\n"); lineno++; + }else{ + fprintf(out,"#ifndef %s%s\n", prefix, lemp->symbols[1]->name); + } + for(i=1; interminal; i++){ + fprintf(out,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i); + lineno++; + } + fprintf(out,"#endif\n"); lineno++; + tplt_xfer(lemp->name,in,out,&lineno); + + /* Generate the defines */ + fprintf(out,"#define YYCODETYPE %s\n", + minimum_size_type(0, lemp->nsymbol, &szCodeType)); lineno++; + fprintf(out,"#define YYNOCODE %d\n",lemp->nsymbol); lineno++; + fprintf(out,"#define YYACTIONTYPE %s\n", + minimum_size_type(0,lemp->maxAction,&szActionType)); lineno++; + if( lemp->wildcard ){ + fprintf(out,"#define YYWILDCARD %d\n", + lemp->wildcard->index); lineno++; + } + print_stack_union(out,lemp,&lineno,mhflag); + fprintf(out, "#ifndef YYSTACKDEPTH\n"); lineno++; + if( lemp->stacksize ){ + fprintf(out,"#define YYSTACKDEPTH %s\n",lemp->stacksize); lineno++; + }else{ + fprintf(out,"#define YYSTACKDEPTH 100\n"); lineno++; + } + fprintf(out, "#endif\n"); lineno++; + if( mhflag ){ + fprintf(out,"#if INTERFACE\n"); lineno++; + } + name = lemp->name ? lemp->name : "Parse"; + if( lemp->arg && lemp->arg[0] ){ + i = lemonStrlen(lemp->arg); + while( i>=1 && ISSPACE(lemp->arg[i-1]) ) i--; + while( i>=1 && (ISALNUM(lemp->arg[i-1]) || lemp->arg[i-1]=='_') ) i--; + fprintf(out,"#define %sARG_SDECL %s;\n",name,lemp->arg); lineno++; + fprintf(out,"#define %sARG_PDECL ,%s\n",name,lemp->arg); lineno++; + fprintf(out,"#define %sARG_PARAM ,%s\n",name,&lemp->arg[i]); lineno++; + fprintf(out,"#define %sARG_FETCH %s=yypParser->%s;\n", + name,lemp->arg,&lemp->arg[i]); lineno++; + fprintf(out,"#define %sARG_STORE yypParser->%s=%s;\n", + name,&lemp->arg[i],&lemp->arg[i]); lineno++; + }else{ + fprintf(out,"#define %sARG_SDECL\n",name); lineno++; + fprintf(out,"#define %sARG_PDECL\n",name); lineno++; + fprintf(out,"#define %sARG_PARAM\n",name); lineno++; + fprintf(out,"#define %sARG_FETCH\n",name); lineno++; + fprintf(out,"#define %sARG_STORE\n",name); lineno++; + } + if( lemp->reallocFunc ){ + fprintf(out,"#define YYREALLOC %s\n", lemp->reallocFunc); lineno++; + }else{ + fprintf(out,"#define YYREALLOC realloc\n"); lineno++; + } + if( lemp->freeFunc ){ + fprintf(out,"#define YYFREE %s\n", lemp->freeFunc); lineno++; + }else{ + fprintf(out,"#define YYFREE free\n"); lineno++; + } + if( lemp->reallocFunc && lemp->freeFunc ){ + fprintf(out,"#define YYDYNSTACK 1\n"); lineno++; + }else{ + fprintf(out,"#define YYDYNSTACK 0\n"); lineno++; + } + if( lemp->ctx && lemp->ctx[0] ){ + i = lemonStrlen(lemp->ctx); + while( i>=1 && ISSPACE(lemp->ctx[i-1]) ) i--; + while( i>=1 && (ISALNUM(lemp->ctx[i-1]) || lemp->ctx[i-1]=='_') ) i--; + fprintf(out,"#define %sCTX_SDECL %s;\n",name,lemp->ctx); lineno++; + fprintf(out,"#define %sCTX_PDECL ,%s\n",name,lemp->ctx); lineno++; + fprintf(out,"#define %sCTX_PARAM ,%s\n",name,&lemp->ctx[i]); lineno++; + fprintf(out,"#define %sCTX_FETCH %s=yypParser->%s;\n", + name,lemp->ctx,&lemp->ctx[i]); lineno++; + fprintf(out,"#define %sCTX_STORE yypParser->%s=%s;\n", + name,&lemp->ctx[i],&lemp->ctx[i]); lineno++; + }else{ + fprintf(out,"#define %sCTX_SDECL\n",name); lineno++; + fprintf(out,"#define %sCTX_PDECL\n",name); lineno++; + fprintf(out,"#define %sCTX_PARAM\n",name); lineno++; + fprintf(out,"#define %sCTX_FETCH\n",name); lineno++; + fprintf(out,"#define %sCTX_STORE\n",name); lineno++; + } + if( mhflag ){ + fprintf(out,"#endif\n"); lineno++; + } + if( lemp->errsym && lemp->errsym->useCnt ){ + fprintf(out,"#define YYERRORSYMBOL %d\n",lemp->errsym->index); lineno++; + fprintf(out,"#define YYERRSYMDT yy%d\n",lemp->errsym->dtnum); lineno++; + } + if( lemp->has_fallback ){ + fprintf(out,"#define YYFALLBACK 1\n"); lineno++; + } + + /* Compute the action table, but do not output it yet. The action + ** table must be computed before generating the YYNSTATE macro because + ** we need to know how many states can be eliminated. + */ + ax = (struct axset *) lemon_calloc(lemp->nxstate*2, sizeof(ax[0])); + if( ax==0 ){ + fprintf(stderr,"malloc failed\n"); + exit(1); + } + for(i=0; inxstate; i++){ + stp = lemp->sorted[i]; + ax[i*2].stp = stp; + ax[i*2].isTkn = 1; + ax[i*2].nAction = stp->nTknAct; + ax[i*2+1].stp = stp; + ax[i*2+1].isTkn = 0; + ax[i*2+1].nAction = stp->nNtAct; + } + mxTknOfst = mnTknOfst = 0; + mxNtOfst = mnNtOfst = 0; + /* In an effort to minimize the action table size, use the heuristic + ** of placing the largest action sets first */ + for(i=0; inxstate*2; i++) ax[i].iOrder = i; + qsort(ax, lemp->nxstate*2, sizeof(ax[0]), axset_compare); + pActtab = acttab_alloc(lemp->nsymbol, lemp->nterminal); + for(i=0; inxstate*2 && ax[i].nAction>0; i++){ + stp = ax[i].stp; + if( ax[i].isTkn ){ + for(ap=stp->ap; ap; ap=ap->next){ + int action; + if( ap->sp->index>=lemp->nterminal ) continue; + action = compute_action(lemp, ap); + if( action<0 ) continue; + acttab_action(pActtab, ap->sp->index, action); + } + stp->iTknOfst = acttab_insert(pActtab, 1); + if( stp->iTknOfstiTknOfst; + if( stp->iTknOfst>mxTknOfst ) mxTknOfst = stp->iTknOfst; + }else{ + for(ap=stp->ap; ap; ap=ap->next){ + int action; + if( ap->sp->indexnterminal ) continue; + if( ap->sp->index==lemp->nsymbol ) continue; + action = compute_action(lemp, ap); + if( action<0 ) continue; + acttab_action(pActtab, ap->sp->index, action); + } + stp->iNtOfst = acttab_insert(pActtab, 0); + if( stp->iNtOfstiNtOfst; + if( stp->iNtOfst>mxNtOfst ) mxNtOfst = stp->iNtOfst; + } +#if 0 /* Uncomment for a trace of how the yy_action[] table fills out */ + { int jj, nn; + for(jj=nn=0; jjnAction; jj++){ + if( pActtab->aAction[jj].action<0 ) nn++; + } + printf("%4d: State %3d %s n: %2d size: %5d freespace: %d\n", + i, stp->statenum, ax[i].isTkn ? "Token" : "Var ", + ax[i].nAction, pActtab->nAction, nn); + } +#endif + } + lemon_free(ax); + + /* Mark rules that are actually used for reduce actions after all + ** optimizations have been applied + */ + for(rp=lemp->rule; rp; rp=rp->next) rp->doesReduce = LEMON_FALSE; + for(i=0; inxstate; i++){ + for(ap=lemp->sorted[i]->ap; ap; ap=ap->next){ + if( ap->type==REDUCE || ap->type==SHIFTREDUCE ){ + ap->x.rp->doesReduce = 1; + } + } + } + + /* Finish rendering the constants now that the action table has + ** been computed */ + fprintf(out,"#define YYNSTATE %d\n",lemp->nxstate); lineno++; + fprintf(out,"#define YYNRULE %d\n",lemp->nrule); lineno++; + fprintf(out,"#define YYNRULE_WITH_ACTION %d\n",lemp->nruleWithAction); + lineno++; + fprintf(out,"#define YYNTOKEN %d\n",lemp->nterminal); lineno++; + fprintf(out,"#define YY_MAX_SHIFT %d\n",lemp->nxstate-1); lineno++; + i = lemp->minShiftReduce; + fprintf(out,"#define YY_MIN_SHIFTREDUCE %d\n",i); lineno++; + i += lemp->nrule; + fprintf(out,"#define YY_MAX_SHIFTREDUCE %d\n", i-1); lineno++; + fprintf(out,"#define YY_ERROR_ACTION %d\n", lemp->errAction); lineno++; + fprintf(out,"#define YY_ACCEPT_ACTION %d\n", lemp->accAction); lineno++; + fprintf(out,"#define YY_NO_ACTION %d\n", lemp->noAction); lineno++; + fprintf(out,"#define YY_MIN_REDUCE %d\n", lemp->minReduce); lineno++; + i = lemp->minReduce + lemp->nrule; + fprintf(out,"#define YY_MAX_REDUCE %d\n", i-1); lineno++; + + /* Minimum and maximum token values that have a destructor */ + mn = mx = 0; + for(i=0; insymbol; i++){ + struct symbol *sp = lemp->symbols[i]; + + if( sp && sp->type!=TERMINAL && sp->destructor ){ + if( mn==0 || sp->indexindex; + if( sp->index>mx ) mx = sp->index; + } + } + if( lemp->tokendest ) mn = 0; + if( lemp->vardest ) mx = lemp->nsymbol-1; + fprintf(out,"#define YY_MIN_DSTRCTR %d\n", mn); lineno++; + fprintf(out,"#define YY_MAX_DSTRCTR %d\n", mx); lineno++; + + tplt_xfer(lemp->name,in,out,&lineno); + + /* Now output the action table and its associates: + ** + ** 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. + */ + + /* Output the yy_action table */ + lemp->nactiontab = n = acttab_action_size(pActtab); + lemp->tablesize += n*szActionType; + fprintf(out,"#define YY_ACTTAB_COUNT (%d)\n", n); lineno++; + fprintf(out,"static const YYACTIONTYPE yy_action[] = {\n"); lineno++; + for(i=j=0; inoAction; + if( j==0 ) fprintf(out," /* %5d */ ", i); + fprintf(out, " %4d,", action); + if( j==9 || i==n-1 ){ + fprintf(out, "\n"); lineno++; + j = 0; + }else{ + j++; + } + } + fprintf(out, "};\n"); lineno++; + + /* Output the yy_lookahead table */ + lemp->nlookaheadtab = n = acttab_lookahead_size(pActtab); + lemp->tablesize += n*szCodeType; + fprintf(out,"static const YYCODETYPE yy_lookahead[] = {\n"); lineno++; + for(i=j=0; insymbol; + if( j==0 ) fprintf(out," /* %5d */ ", i); + fprintf(out, " %4d,", la); + if( j==9 ){ + fprintf(out, "\n"); lineno++; + j = 0; + }else{ + j++; + } + } + /* Add extra entries to the end of the yy_lookahead[] table so that + ** yy_shift_ofst[]+iToken will always be a valid index into the array, + ** even for the largest possible value of yy_shift_ofst[] and iToken. */ + nLookAhead = lemp->nterminal + lemp->nactiontab; + while( interminal); + if( j==9 ){ + fprintf(out, "\n"); lineno++; + j = 0; + }else{ + j++; + } + i++; + } + if( j>0 ){ fprintf(out, "\n"); lineno++; } + fprintf(out, "};\n"); lineno++; + + /* Output the yy_shift_ofst[] table */ + n = lemp->nxstate; + while( n>0 && lemp->sorted[n-1]->iTknOfst==NO_OFFSET ) n--; + fprintf(out, "#define YY_SHIFT_COUNT (%d)\n", n-1); lineno++; + fprintf(out, "#define YY_SHIFT_MIN (%d)\n", mnTknOfst); lineno++; + fprintf(out, "#define YY_SHIFT_MAX (%d)\n", mxTknOfst); lineno++; + fprintf(out, "static const %s yy_shift_ofst[] = {\n", + minimum_size_type(mnTknOfst, lemp->nterminal+lemp->nactiontab, &sz)); + lineno++; + lemp->tablesize += n*sz; + for(i=j=0; isorted[i]; + ofst = stp->iTknOfst; + if( ofst==NO_OFFSET ) ofst = lemp->nactiontab; + if( j==0 ) fprintf(out," /* %5d */ ", i); + fprintf(out, " %4d,", ofst); + if( j==9 || i==n-1 ){ + fprintf(out, "\n"); lineno++; + j = 0; + }else{ + j++; + } + } + fprintf(out, "};\n"); lineno++; + + /* Output the yy_reduce_ofst[] table */ + n = lemp->nxstate; + while( n>0 && lemp->sorted[n-1]->iNtOfst==NO_OFFSET ) n--; + fprintf(out, "#define YY_REDUCE_COUNT (%d)\n", n-1); lineno++; + fprintf(out, "#define YY_REDUCE_MIN (%d)\n", mnNtOfst); lineno++; + fprintf(out, "#define YY_REDUCE_MAX (%d)\n", mxNtOfst); lineno++; + fprintf(out, "static const %s yy_reduce_ofst[] = {\n", + minimum_size_type(mnNtOfst-1, mxNtOfst, &sz)); lineno++; + lemp->tablesize += n*sz; + for(i=j=0; isorted[i]; + ofst = stp->iNtOfst; + if( ofst==NO_OFFSET ) ofst = mnNtOfst - 1; + if( j==0 ) fprintf(out," /* %5d */ ", i); + fprintf(out, " %4d,", ofst); + if( j==9 || i==n-1 ){ + fprintf(out, "\n"); lineno++; + j = 0; + }else{ + j++; + } + } + fprintf(out, "};\n"); lineno++; + + /* Output the default action table */ + fprintf(out, "static const YYACTIONTYPE yy_default[] = {\n"); lineno++; + n = lemp->nxstate; + lemp->tablesize += n*szActionType; + for(i=j=0; isorted[i]; + if( j==0 ) fprintf(out," /* %5d */ ", i); + if( stp->iDfltReduce<0 ){ + fprintf(out, " %4d,", lemp->errAction); + }else{ + fprintf(out, " %4d,", stp->iDfltReduce + lemp->minReduce); + } + if( j==9 || i==n-1 ){ + fprintf(out, "\n"); lineno++; + j = 0; + }else{ + j++; + } + } + fprintf(out, "};\n"); lineno++; + tplt_xfer(lemp->name,in,out,&lineno); + + /* Generate the table of fallback tokens. + */ + if( lemp->has_fallback ){ + mx = lemp->nterminal - 1; + /* 2019-08-28: Generate fallback entries for every token to avoid + ** having to do a range check on the index */ + /* while( mx>0 && lemp->symbols[mx]->fallback==0 ){ mx--; } */ + lemp->tablesize += (mx+1)*szCodeType; + for(i=0; i<=mx; i++){ + struct symbol *p = lemp->symbols[i]; + if( p->fallback==0 ){ + fprintf(out, " 0, /* %10s => nothing */\n", p->name); + }else{ + fprintf(out, " %3d, /* %10s => %s */\n", p->fallback->index, + p->name, p->fallback->name); + } + lineno++; + } + } + tplt_xfer(lemp->name, in, out, &lineno); + + /* Generate a table containing the symbolic name of every symbol + */ + for(i=0; insymbol; i++){ + fprintf(out," /* %4d */ \"%s\",\n",i, lemp->symbols[i]->name); lineno++; + } + tplt_xfer(lemp->name,in,out,&lineno); + + /* Generate a table containing a text string that describes every + ** rule in the rule set of the grammar. This information is used + ** when tracing REDUCE actions. + */ + for(i=0, rp=lemp->rule; rp; rp=rp->next, i++){ + assert( rp->iRule==i ); + fprintf(out," /* %3d */ \"", i); + writeRuleText(out, rp); + fprintf(out,"\",\n"); lineno++; + } + tplt_xfer(lemp->name,in,out,&lineno); + + /* Generate code which executes every time a symbol is popped from + ** the stack while processing errors or while destroying the parser. + ** (In other words, generate the %destructor actions) + */ + if( lemp->tokendest ){ + int once = 1; + for(i=0; insymbol; i++){ + struct symbol *sp = lemp->symbols[i]; + if( sp==0 || sp->type!=TERMINAL ) continue; + if( once ){ + fprintf(out, " /* TERMINAL Destructor */\n"); lineno++; + once = 0; + } + fprintf(out," case %d: /* %s */\n", sp->index, sp->name); lineno++; + } + for(i=0; insymbol && lemp->symbols[i]->type!=TERMINAL; i++); + if( insymbol ){ + emit_destructor_code(out,lemp->symbols[i],lemp,&lineno); + fprintf(out," break;\n"); lineno++; + } + } + if( lemp->vardest ){ + struct symbol *dflt_sp = 0; + int once = 1; + for(i=0; insymbol; i++){ + struct symbol *sp = lemp->symbols[i]; + if( sp==0 || sp->type==TERMINAL || + sp->index<=0 || sp->destructor!=0 ) continue; + if( once ){ + fprintf(out, " /* Default NON-TERMINAL Destructor */\n");lineno++; + once = 0; + } + fprintf(out," case %d: /* %s */\n", sp->index, sp->name); lineno++; + dflt_sp = sp; + } + if( dflt_sp!=0 ){ + emit_destructor_code(out,dflt_sp,lemp,&lineno); + } + fprintf(out," break;\n"); lineno++; + } + for(i=0; insymbol; i++){ + struct symbol *sp = lemp->symbols[i]; + if( sp==0 || sp->type==TERMINAL || sp->destructor==0 ) continue; + if( sp->destLineno<0 ) continue; /* Already emitted */ + fprintf(out," case %d: /* %s */\n", sp->index, sp->name); lineno++; + + /* Combine duplicate destructors into a single case */ + for(j=i+1; jnsymbol; j++){ + struct symbol *sp2 = lemp->symbols[j]; + if( sp2 && sp2->type!=TERMINAL && sp2->destructor + && sp2->dtnum==sp->dtnum + && strcmp(sp->destructor,sp2->destructor)==0 ){ + fprintf(out," case %d: /* %s */\n", + sp2->index, sp2->name); lineno++; + sp2->destLineno = -1; /* Avoid emitting this destructor again */ + } + } + + emit_destructor_code(out,lemp->symbols[i],lemp,&lineno); + fprintf(out," break;\n"); lineno++; + } + tplt_xfer(lemp->name,in,out,&lineno); + + /* Generate code which executes whenever the parser stack overflows */ + tplt_print(out,lemp,lemp->overflow,&lineno); + tplt_xfer(lemp->name,in,out,&lineno); + + /* Generate the tables of rule information. yyRuleInfoLhs[] and + ** yyRuleInfoNRhs[]. + ** + ** Note: This code depends on the fact that rules are number + ** sequentially beginning with 0. + */ + for(i=0, rp=lemp->rule; rp; rp=rp->next, i++){ + fprintf(out," %4d, /* (%d) ", rp->lhs->index, i); + rule_print(out, rp); + fprintf(out," */\n"); lineno++; + } + tplt_xfer(lemp->name,in,out,&lineno); + for(i=0, rp=lemp->rule; rp; rp=rp->next, i++){ + fprintf(out," %3d, /* (%d) ", -rp->nrhs, i); + rule_print(out, rp); + fprintf(out," */\n"); lineno++; + } + tplt_xfer(lemp->name,in,out,&lineno); + + /* Generate code which execution during each REDUCE action */ + i = 0; + for(rp=lemp->rule; rp; rp=rp->next){ + i += translate_code(lemp, rp); + } + if( i ){ + fprintf(out," YYMINORTYPE yylhsminor;\n"); lineno++; + } + /* First output rules other than the default: rule */ + for(rp=lemp->rule; rp; rp=rp->next){ + struct rule *rp2; /* Other rules with the same action */ + if( rp->codeEmitted ) continue; + if( rp->noCode ){ + /* No C code actions, so this will be part of the "default:" rule */ + continue; + } + fprintf(out," case %d: /* ", rp->iRule); + writeRuleText(out, rp); + fprintf(out, " */\n"); lineno++; + for(rp2=rp->next; rp2; rp2=rp2->next){ + if( rp2->code==rp->code && rp2->codePrefix==rp->codePrefix + && rp2->codeSuffix==rp->codeSuffix ){ + fprintf(out," case %d: /* ", rp2->iRule); + writeRuleText(out, rp2); + fprintf(out," */ yytestcase(yyruleno==%d);\n", rp2->iRule); lineno++; + rp2->codeEmitted = 1; + } + } + emit_code(out,rp,lemp,&lineno); + fprintf(out," break;\n"); lineno++; + rp->codeEmitted = 1; + } + /* Finally, output the default: rule. We choose as the default: all + ** empty actions. */ + fprintf(out," default:\n"); lineno++; + for(rp=lemp->rule; rp; rp=rp->next){ + if( rp->codeEmitted ) continue; + assert( rp->noCode ); + fprintf(out," /* (%d) ", rp->iRule); + writeRuleText(out, rp); + if( rp->neverReduce ){ + fprintf(out, " (NEVER REDUCES) */ assert(yyruleno!=%d);\n", + rp->iRule); lineno++; + }else if( rp->doesReduce ){ + fprintf(out, " */ yytestcase(yyruleno==%d);\n", rp->iRule); lineno++; + }else{ + fprintf(out, " (OPTIMIZED OUT) */ assert(yyruleno!=%d);\n", + rp->iRule); lineno++; + } + } + fprintf(out," break;\n"); lineno++; + tplt_xfer(lemp->name,in,out,&lineno); + + /* Generate code which executes if a parse fails */ + tplt_print(out,lemp,lemp->failure,&lineno); + tplt_xfer(lemp->name,in,out,&lineno); + + /* Generate code which executes when a syntax error occurs */ + tplt_print(out,lemp,lemp->error,&lineno); + tplt_xfer(lemp->name,in,out,&lineno); + + /* Generate code which executes when the parser accepts its input */ + tplt_print(out,lemp,lemp->accept,&lineno); + tplt_xfer(lemp->name,in,out,&lineno); + + /* Append any addition code the user desires */ + tplt_print(out,lemp,lemp->extracode,&lineno); + + acttab_free(pActtab); + fclose(in); + fclose(out); + if( sql ) fclose(sql); + return; +} + +/* Generate a header file for the parser */ +void ReportHeader(struct lemon *lemp) +{ + FILE *out, *in; + const char *prefix; + char line[LINESIZE]; + char pattern[LINESIZE]; + int i; + + if( lemp->tokenprefix ) prefix = lemp->tokenprefix; + else prefix = ""; + in = file_open(lemp,".h","rb"); + if( in ){ + int nextChar; + for(i=1; interminal && fgets(line,LINESIZE,in); i++){ + lemon_sprintf(pattern,"#define %s%-30s %3d\n", + prefix,lemp->symbols[i]->name,i); + if( strcmp(line,pattern) ) break; + } + nextChar = fgetc(in); + fclose(in); + if( i==lemp->nterminal && nextChar==EOF ){ + /* No change in the file. Don't rewrite it. */ + return; + } + } + out = file_open(lemp,".h","wb"); + if( out ){ + for(i=1; interminal; i++){ + fprintf(out,"#define %s%-30s %3d\n",prefix,lemp->symbols[i]->name,i); + } + fclose(out); + } + return; +} + +/* Reduce the size of the action tables, if possible, by making use +** of defaults. +** +** In this version, we take the most frequent REDUCE action and make +** it the default. Except, there is no default if the wildcard token +** is a possible look-ahead. +*/ +void CompressTables(struct lemon *lemp) +{ + struct state *stp; + struct action *ap, *ap2, *nextap; + struct rule *rp, *rp2, *rbest; + int nbest, n; + int i; + int usesWildcard; + + for(i=0; instate; i++){ + stp = lemp->sorted[i]; + nbest = 0; + rbest = 0; + usesWildcard = 0; + + for(ap=stp->ap; ap; ap=ap->next){ + if( ap->type==SHIFT && ap->sp==lemp->wildcard ){ + usesWildcard = 1; + } + if( ap->type!=REDUCE ) continue; + rp = ap->x.rp; + if( rp->lhsStart ) continue; + if( rp==rbest ) continue; + n = 1; + for(ap2=ap->next; ap2; ap2=ap2->next){ + if( ap2->type!=REDUCE ) continue; + rp2 = ap2->x.rp; + if( rp2==rbest ) continue; + if( rp2==rp ) n++; + } + if( n>nbest ){ + nbest = n; + rbest = rp; + } + } + + /* Do not make a default if the number of rules to default + ** is not at least 1 or if the wildcard token is a possible + ** lookahead. + */ + if( nbest<1 || usesWildcard ) continue; + + + /* Combine matching REDUCE actions into a single default */ + for(ap=stp->ap; ap; ap=ap->next){ + if( ap->type==REDUCE && ap->x.rp==rbest ) break; + } + assert( ap ); + ap->sp = Symbol_new("{default}"); + for(ap=ap->next; ap; ap=ap->next){ + if( ap->type==REDUCE && ap->x.rp==rbest ) ap->type = NOT_USED; + } + stp->ap = Action_sort(stp->ap); + + for(ap=stp->ap; ap; ap=ap->next){ + if( ap->type==SHIFT ) break; + if( ap->type==REDUCE && ap->x.rp!=rbest ) break; + } + if( ap==0 ){ + stp->autoReduce = 1; + stp->pDfltReduce = rbest; + } + } + + /* Make a second pass over all states and actions. Convert + ** every action that is a SHIFT to an autoReduce state into + ** a SHIFTREDUCE action. + */ + for(i=0; instate; i++){ + stp = lemp->sorted[i]; + for(ap=stp->ap; ap; ap=ap->next){ + struct state *pNextState; + if( ap->type!=SHIFT ) continue; + pNextState = ap->x.stp; + if( pNextState->autoReduce && pNextState->pDfltReduce!=0 ){ + ap->type = SHIFTREDUCE; + ap->x.rp = pNextState->pDfltReduce; + } + } + } + + /* If a SHIFTREDUCE action specifies a rule that has a single RHS term + ** (meaning that the SHIFTREDUCE will land back in the state where it + ** started) and if there is no C-code associated with the reduce action, + ** then we can go ahead and convert the action to be the same as the + ** action for the RHS of the rule. + */ + for(i=0; instate; i++){ + stp = lemp->sorted[i]; + for(ap=stp->ap; ap; ap=nextap){ + nextap = ap->next; + if( ap->type!=SHIFTREDUCE ) continue; + rp = ap->x.rp; + if( rp->noCode==0 ) continue; + if( rp->nrhs!=1 ) continue; +#if 1 + /* Only apply this optimization to non-terminals. It would be OK to + ** apply it to terminal symbols too, but that makes the parser tables + ** larger. */ + if( ap->sp->indexnterminal ) continue; +#endif + /* If we reach this point, it means the optimization can be applied */ + nextap = ap; + for(ap2=stp->ap; ap2 && (ap2==ap || ap2->sp!=rp->lhs); ap2=ap2->next){} + assert( ap2!=0 ); + ap->spOpt = ap2->sp; + ap->type = ap2->type; + ap->x = ap2->x; + } + } +} + + +/* +** Compare two states for sorting purposes. The smaller state is the +** one with the most non-terminal actions. If they have the same number +** of non-terminal actions, then the smaller is the one with the most +** token actions. +*/ +static int stateResortCompare(const void *a, const void *b){ + const struct state *pA = *(const struct state**)a; + const struct state *pB = *(const struct state**)b; + int n; + + n = pB->nNtAct - pA->nNtAct; + if( n==0 ){ + n = pB->nTknAct - pA->nTknAct; + if( n==0 ){ + n = pB->statenum - pA->statenum; + } + } + assert( n!=0 ); + return n; +} + + +/* +** Renumber and resort states so that states with fewer choices +** occur at the end. Except, keep state 0 as the first state. +*/ +void ResortStates(struct lemon *lemp) +{ + int i; + struct state *stp; + struct action *ap; + + for(i=0; instate; i++){ + stp = lemp->sorted[i]; + stp->nTknAct = stp->nNtAct = 0; + stp->iDfltReduce = -1; /* Init dflt action to "syntax error" */ + stp->iTknOfst = NO_OFFSET; + stp->iNtOfst = NO_OFFSET; + for(ap=stp->ap; ap; ap=ap->next){ + int iAction = compute_action(lemp,ap); + if( iAction>=0 ){ + if( ap->sp->indexnterminal ){ + stp->nTknAct++; + }else if( ap->sp->indexnsymbol ){ + stp->nNtAct++; + }else{ + assert( stp->autoReduce==0 || stp->pDfltReduce==ap->x.rp ); + stp->iDfltReduce = iAction; + } + } + } + } + qsort(&lemp->sorted[1], lemp->nstate-1, sizeof(lemp->sorted[0]), + stateResortCompare); + for(i=0; instate; i++){ + lemp->sorted[i]->statenum = i; + } + lemp->nxstate = lemp->nstate; + while( lemp->nxstate>1 && lemp->sorted[lemp->nxstate-1]->autoReduce ){ + lemp->nxstate--; + } +} + + +/***************** From the file "set.c" ************************************/ +/* +** Set manipulation routines for the LEMON parser generator. +*/ + +static int size = 0; + +/* Set the set size */ +void SetSize(int n) +{ + size = n+1; +} + +/* Allocate a new set */ +char *SetNew(void){ + char *s; + s = (char*)lemon_calloc( size, 1); + if( s==0 ){ + memory_error(); + } + return s; +} + +/* Deallocate a set */ +void SetFree(char *s) +{ + lemon_free(s); +} + +/* Add a new element to the set. Return TRUE if the element was added +** and FALSE if it was already there. */ +int SetAdd(char *s, int e) +{ + int rv; + assert( e>=0 && esize = 1024; + x1a->count = 0; + x1a->tbl = (x1node*)lemon_calloc(1024, sizeof(x1node) + sizeof(x1node*)); + if( x1a->tbl==0 ){ + lemon_free(x1a); + x1a = 0; + }else{ + int i; + x1a->ht = (x1node**)&(x1a->tbl[1024]); + for(i=0; i<1024; i++) x1a->ht[i] = 0; + } + } +} +/* Insert a new record into the array. Return TRUE if successful. +** Prior data with the same key is NOT overwritten */ +int Strsafe_insert(const char *data) +{ + x1node *np; + unsigned h; + unsigned ph; + + if( x1a==0 ) return 0; + ph = strhash(data); + h = ph & (x1a->size-1); + np = x1a->ht[h]; + while( np ){ + if( strcmp(np->data,data)==0 ){ + /* An existing entry with the same key is found. */ + /* Fail because overwrite is not allows. */ + return 0; + } + np = np->next; + } + if( x1a->count>=x1a->size ){ + /* Need to make the hash table bigger */ + int i,arrSize; + struct s_x1 array; + array.size = arrSize = x1a->size*2; + array.count = x1a->count; + array.tbl = (x1node*)lemon_calloc(arrSize, sizeof(x1node)+sizeof(x1node*)); + if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ + array.ht = (x1node**)&(array.tbl[arrSize]); + for(i=0; icount; i++){ + x1node *oldnp, *newnp; + oldnp = &(x1a->tbl[i]); + h = strhash(oldnp->data) & (arrSize-1); + newnp = &(array.tbl[i]); + if( array.ht[h] ) array.ht[h]->from = &(newnp->next); + newnp->next = array.ht[h]; + newnp->data = oldnp->data; + newnp->from = &(array.ht[h]); + array.ht[h] = newnp; + } + /* lemon_free(x1a->tbl); // This program was originally for 16-bit machines. + ** Don't worry about freeing memory on modern platforms. */ + *x1a = array; + } + /* Insert the new data */ + h = ph & (x1a->size-1); + np = &(x1a->tbl[x1a->count++]); + np->data = data; + if( x1a->ht[h] ) x1a->ht[h]->from = &(np->next); + np->next = x1a->ht[h]; + x1a->ht[h] = np; + np->from = &(x1a->ht[h]); + return 1; +} + +/* Return a pointer to data assigned to the given key. Return NULL +** if no such key. */ +const char *Strsafe_find(const char *key) +{ + unsigned h; + x1node *np; + + if( x1a==0 ) return 0; + h = strhash(key) & (x1a->size-1); + np = x1a->ht[h]; + while( np ){ + if( strcmp(np->data,key)==0 ) break; + np = np->next; + } + return np ? np->data : 0; +} + +/* Return a pointer to the (terminal or nonterminal) symbol "x". +** Create a new symbol if this is the first time "x" has been seen. +*/ +struct symbol *Symbol_new(const char *x) +{ + struct symbol *sp; + + sp = Symbol_find(x); + if( sp==0 ){ + sp = (struct symbol *)lemon_calloc(1, sizeof(struct symbol) ); + MemoryCheck(sp); + sp->name = Strsafe(x); + sp->type = ISUPPER(*x) ? TERMINAL : NONTERMINAL; + sp->rule = 0; + sp->fallback = 0; + sp->prec = -1; + sp->assoc = UNK; + sp->firstset = 0; + sp->lambda = LEMON_FALSE; + sp->destructor = 0; + sp->destLineno = 0; + sp->datatype = 0; + sp->useCnt = 0; + Symbol_insert(sp,sp->name); + } + sp->useCnt++; + return sp; +} + +/* Compare two symbols for sorting purposes. Return negative, +** zero, or positive if a is less then, equal to, or greater +** than b. +** +** Symbols that begin with upper case letters (terminals or tokens) +** must sort before symbols that begin with lower case letters +** (non-terminals). And MULTITERMINAL symbols (created using the +** %token_class directive) must sort at the very end. Other than +** that, the order does not matter. +** +** We find experimentally that leaving the symbols in their original +** order (the order they appeared in the grammar file) gives the +** smallest parser tables in SQLite. +*/ +int Symbolcmpp(const void *_a, const void *_b) +{ + const struct symbol *a = *(const struct symbol **) _a; + const struct symbol *b = *(const struct symbol **) _b; + int i1 = a->type==MULTITERMINAL ? 3 : a->name[0]>'Z' ? 2 : 1; + int i2 = b->type==MULTITERMINAL ? 3 : b->name[0]>'Z' ? 2 : 1; + return i1==i2 ? a->index - b->index : i1 - i2; +} + +/* There is one instance of the following structure for each +** associative array of type "x2". +*/ +struct s_x2 { + int size; /* The number of available slots. */ + /* Must be a power of 2 greater than or */ + /* equal to 1 */ + int count; /* Number of currently slots filled */ + struct s_x2node *tbl; /* The data stored here */ + struct s_x2node **ht; /* Hash table for lookups */ +}; + +/* There is one instance of this structure for every data element +** in an associative array of type "x2". +*/ +typedef struct s_x2node { + struct symbol *data; /* The data */ + const char *key; /* The key */ + struct s_x2node *next; /* Next entry with the same hash */ + struct s_x2node **from; /* Previous link */ +} x2node; + +/* There is only one instance of the array, which is the following */ +static struct s_x2 *x2a; + +/* Allocate a new associative array */ +void Symbol_init(void){ + if( x2a ) return; + x2a = (struct s_x2*)lemon_malloc( sizeof(struct s_x2) ); + if( x2a ){ + x2a->size = 128; + x2a->count = 0; + x2a->tbl = (x2node*)lemon_calloc(128, sizeof(x2node) + sizeof(x2node*)); + if( x2a->tbl==0 ){ + lemon_free(x2a); + x2a = 0; + }else{ + int i; + x2a->ht = (x2node**)&(x2a->tbl[128]); + for(i=0; i<128; i++) x2a->ht[i] = 0; + } + } +} +/* Insert a new record into the array. Return TRUE if successful. +** Prior data with the same key is NOT overwritten */ +int Symbol_insert(struct symbol *data, const char *key) +{ + x2node *np; + unsigned h; + unsigned ph; + + if( x2a==0 ) return 0; + ph = strhash(key); + h = ph & (x2a->size-1); + np = x2a->ht[h]; + while( np ){ + if( strcmp(np->key,key)==0 ){ + /* An existing entry with the same key is found. */ + /* Fail because overwrite is not allows. */ + return 0; + } + np = np->next; + } + if( x2a->count>=x2a->size ){ + /* Need to make the hash table bigger */ + int i,arrSize; + struct s_x2 array; + array.size = arrSize = x2a->size*2; + array.count = x2a->count; + array.tbl = (x2node*)lemon_calloc(arrSize, sizeof(x2node)+sizeof(x2node*)); + if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ + array.ht = (x2node**)&(array.tbl[arrSize]); + for(i=0; icount; i++){ + x2node *oldnp, *newnp; + oldnp = &(x2a->tbl[i]); + h = strhash(oldnp->key) & (arrSize-1); + newnp = &(array.tbl[i]); + if( array.ht[h] ) array.ht[h]->from = &(newnp->next); + newnp->next = array.ht[h]; + newnp->key = oldnp->key; + newnp->data = oldnp->data; + newnp->from = &(array.ht[h]); + array.ht[h] = newnp; + } + /* lemon_free(x2a->tbl); // This program was originally written for 16-bit + ** machines. Don't worry about freeing this trivial amount of memory + ** on modern platforms. Just leak it. */ + *x2a = array; + } + /* Insert the new data */ + h = ph & (x2a->size-1); + np = &(x2a->tbl[x2a->count++]); + np->key = key; + np->data = data; + if( x2a->ht[h] ) x2a->ht[h]->from = &(np->next); + np->next = x2a->ht[h]; + x2a->ht[h] = np; + np->from = &(x2a->ht[h]); + return 1; +} + +/* Return a pointer to data assigned to the given key. Return NULL +** if no such key. */ +struct symbol *Symbol_find(const char *key) +{ + unsigned h; + x2node *np; + + if( x2a==0 ) return 0; + h = strhash(key) & (x2a->size-1); + np = x2a->ht[h]; + while( np ){ + if( strcmp(np->key,key)==0 ) break; + np = np->next; + } + return np ? np->data : 0; +} + +/* Return the n-th data. Return NULL if n is out of range. */ +struct symbol *Symbol_Nth(int n) +{ + struct symbol *data; + if( x2a && n>0 && n<=x2a->count ){ + data = x2a->tbl[n-1].data; + }else{ + data = 0; + } + return data; +} + +/* Return the size of the array */ +int Symbol_count() +{ + return x2a ? x2a->count : 0; +} + +/* Return an array of pointers to all data in the table. +** The array is obtained from malloc. Return NULL if memory allocation +** problems, or if the array is empty. */ +struct symbol **Symbol_arrayof() +{ + struct symbol **array; + int i,arrSize; + if( x2a==0 ) return 0; + arrSize = x2a->count; + array = (struct symbol **)lemon_calloc(arrSize, sizeof(struct symbol *)); + if( array ){ + for(i=0; itbl[i].data; + } + return array; +} + +/* Compare two configurations */ +int Configcmp(const char *_a,const char *_b) +{ + const struct config *a = (struct config *) _a; + const struct config *b = (struct config *) _b; + int x; + x = a->rp->index - b->rp->index; + if( x==0 ) x = a->dot - b->dot; + return x; +} + +/* Compare two states */ +PRIVATE int statecmp(struct config *a, struct config *b) +{ + int rc; + for(rc=0; rc==0 && a && b; a=a->bp, b=b->bp){ + rc = a->rp->index - b->rp->index; + if( rc==0 ) rc = a->dot - b->dot; + } + if( rc==0 ){ + if( a ) rc = 1; + if( b ) rc = -1; + } + return rc; +} + +/* Hash a state */ +PRIVATE unsigned statehash(struct config *a) +{ + unsigned h=0; + while( a ){ + h = h*571 + a->rp->index*37 + a->dot; + a = a->bp; + } + return h; +} + +/* Allocate a new state structure */ +struct state *State_new() +{ + struct state *newstate; + newstate = (struct state *)lemon_calloc(1, sizeof(struct state) ); + MemoryCheck(newstate); + return newstate; +} + +/* There is one instance of the following structure for each +** associative array of type "x3". +*/ +struct s_x3 { + int size; /* The number of available slots. */ + /* Must be a power of 2 greater than or */ + /* equal to 1 */ + int count; /* Number of currently slots filled */ + struct s_x3node *tbl; /* The data stored here */ + struct s_x3node **ht; /* Hash table for lookups */ +}; + +/* There is one instance of this structure for every data element +** in an associative array of type "x3". +*/ +typedef struct s_x3node { + struct state *data; /* The data */ + struct config *key; /* The key */ + struct s_x3node *next; /* Next entry with the same hash */ + struct s_x3node **from; /* Previous link */ +} x3node; + +/* There is only one instance of the array, which is the following */ +static struct s_x3 *x3a; + +/* Allocate a new associative array */ +void State_init(void){ + if( x3a ) return; + x3a = (struct s_x3*)lemon_malloc( sizeof(struct s_x3) ); + if( x3a ){ + x3a->size = 128; + x3a->count = 0; + x3a->tbl = (x3node*)lemon_calloc(128, sizeof(x3node) + sizeof(x3node*)); + if( x3a->tbl==0 ){ + lemon_free(x3a); + x3a = 0; + }else{ + int i; + x3a->ht = (x3node**)&(x3a->tbl[128]); + for(i=0; i<128; i++) x3a->ht[i] = 0; + } + } +} +/* Insert a new record into the array. Return TRUE if successful. +** Prior data with the same key is NOT overwritten */ +int State_insert(struct state *data, struct config *key) +{ + x3node *np; + unsigned h; + unsigned ph; + + if( x3a==0 ) return 0; + ph = statehash(key); + h = ph & (x3a->size-1); + np = x3a->ht[h]; + while( np ){ + if( statecmp(np->key,key)==0 ){ + /* An existing entry with the same key is found. */ + /* Fail because overwrite is not allows. */ + return 0; + } + np = np->next; + } + if( x3a->count>=x3a->size ){ + /* Need to make the hash table bigger */ + int i,arrSize; + struct s_x3 array; + array.size = arrSize = x3a->size*2; + array.count = x3a->count; + array.tbl = (x3node*)lemon_calloc(arrSize, sizeof(x3node)+sizeof(x3node*)); + if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ + array.ht = (x3node**)&(array.tbl[arrSize]); + for(i=0; icount; i++){ + x3node *oldnp, *newnp; + oldnp = &(x3a->tbl[i]); + h = statehash(oldnp->key) & (arrSize-1); + newnp = &(array.tbl[i]); + if( array.ht[h] ) array.ht[h]->from = &(newnp->next); + newnp->next = array.ht[h]; + newnp->key = oldnp->key; + newnp->data = oldnp->data; + newnp->from = &(array.ht[h]); + array.ht[h] = newnp; + } + lemon_free(x3a->tbl); + *x3a = array; + } + /* Insert the new data */ + h = ph & (x3a->size-1); + np = &(x3a->tbl[x3a->count++]); + np->key = key; + np->data = data; + if( x3a->ht[h] ) x3a->ht[h]->from = &(np->next); + np->next = x3a->ht[h]; + x3a->ht[h] = np; + np->from = &(x3a->ht[h]); + return 1; +} + +/* Return a pointer to data assigned to the given key. Return NULL +** if no such key. */ +struct state *State_find(struct config *key) +{ + unsigned h; + x3node *np; + + if( x3a==0 ) return 0; + h = statehash(key) & (x3a->size-1); + np = x3a->ht[h]; + while( np ){ + if( statecmp(np->key,key)==0 ) break; + np = np->next; + } + return np ? np->data : 0; +} + +/* Return an array of pointers to all data in the table. +** The array is obtained from malloc. Return NULL if memory allocation +** problems, or if the array is empty. */ +struct state **State_arrayof(void) +{ + struct state **array; + int i,arrSize; + if( x3a==0 ) return 0; + arrSize = x3a->count; + array = (struct state **)lemon_calloc(arrSize, sizeof(struct state *)); + if( array ){ + for(i=0; itbl[i].data; + } + return array; +} + +/* Hash a configuration */ +PRIVATE unsigned confighash(struct config *a) +{ + unsigned h=0; + h = h*571 + a->rp->index*37 + a->dot; + return h; +} + +/* There is one instance of the following structure for each +** associative array of type "x4". +*/ +struct s_x4 { + int size; /* The number of available slots. */ + /* Must be a power of 2 greater than or */ + /* equal to 1 */ + int count; /* Number of currently slots filled */ + struct s_x4node *tbl; /* The data stored here */ + struct s_x4node **ht; /* Hash table for lookups */ +}; + +/* There is one instance of this structure for every data element +** in an associative array of type "x4". +*/ +typedef struct s_x4node { + struct config *data; /* The data */ + struct s_x4node *next; /* Next entry with the same hash */ + struct s_x4node **from; /* Previous link */ +} x4node; + +/* There is only one instance of the array, which is the following */ +static struct s_x4 *x4a; + +/* Allocate a new associative array */ +void Configtable_init(void){ + if( x4a ) return; + x4a = (struct s_x4*)lemon_malloc( sizeof(struct s_x4) ); + if( x4a ){ + x4a->size = 64; + x4a->count = 0; + x4a->tbl = (x4node*)lemon_calloc(64, sizeof(x4node) + sizeof(x4node*)); + if( x4a->tbl==0 ){ + lemon_free(x4a); + x4a = 0; + }else{ + int i; + x4a->ht = (x4node**)&(x4a->tbl[64]); + for(i=0; i<64; i++) x4a->ht[i] = 0; + } + } +} +/* Insert a new record into the array. Return TRUE if successful. +** Prior data with the same key is NOT overwritten */ +int Configtable_insert(struct config *data) +{ + x4node *np; + unsigned h; + unsigned ph; + + if( x4a==0 ) return 0; + ph = confighash(data); + h = ph & (x4a->size-1); + np = x4a->ht[h]; + while( np ){ + if( Configcmp((const char *) np->data,(const char *) data)==0 ){ + /* An existing entry with the same key is found. */ + /* Fail because overwrite is not allows. */ + return 0; + } + np = np->next; + } + if( x4a->count>=x4a->size ){ + /* Need to make the hash table bigger */ + int i,arrSize; + struct s_x4 array; + array.size = arrSize = x4a->size*2; + array.count = x4a->count; + array.tbl = (x4node*)lemon_calloc(arrSize, + sizeof(x4node) + sizeof(x4node*)); + if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ + array.ht = (x4node**)&(array.tbl[arrSize]); + for(i=0; icount; i++){ + x4node *oldnp, *newnp; + oldnp = &(x4a->tbl[i]); + h = confighash(oldnp->data) & (arrSize-1); + newnp = &(array.tbl[i]); + if( array.ht[h] ) array.ht[h]->from = &(newnp->next); + newnp->next = array.ht[h]; + newnp->data = oldnp->data; + newnp->from = &(array.ht[h]); + array.ht[h] = newnp; + } + *x4a = array; + } + /* Insert the new data */ + h = ph & (x4a->size-1); + np = &(x4a->tbl[x4a->count++]); + np->data = data; + if( x4a->ht[h] ) x4a->ht[h]->from = &(np->next); + np->next = x4a->ht[h]; + x4a->ht[h] = np; + np->from = &(x4a->ht[h]); + return 1; +} + +/* Return a pointer to data assigned to the given key. Return NULL +** if no such key. */ +struct config *Configtable_find(struct config *key) +{ + int h; + x4node *np; + + if( x4a==0 ) return 0; + h = confighash(key) & (x4a->size-1); + np = x4a->ht[h]; + while( np ){ + if( Configcmp((const char *) np->data,(const char *) key)==0 ) break; + np = np->next; + } + return np ? np->data : 0; +} + +/* Remove all data from the table. Pass each data to the function "f" +** as it is removed. ("f" may be null to avoid this step.) */ +void Configtable_clear(int(*f)(struct config *)) +{ + int i; + if( x4a==0 || x4a->count==0 ) return; + if( f ) for(i=0; icount; i++) (*f)(x4a->tbl[i].data); + for(i=0; isize; i++) x4a->ht[i] = 0; + x4a->count = 0; + return; +} diff --git a/contrib/lemon/lempar.c b/contrib/lemon/lempar.c new file mode 100644 index 0000000000..851a0e2e54 --- /dev/null +++ b/contrib/lemon/lempar.c @@ -0,0 +1,1086 @@ +/* +** 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: +*/ +/************ Begin %include sections from the grammar ************************/ +%% +/**************** End of %include directives **********************************/ +/* These constants specify the various numeric values for terminal symbols. +***************** Begin token definitions *************************************/ +%% +/**************** End 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. +** ParseTOKENTYPE is the data type used for minor type for terminal +** 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 +** which is ParseTOKENTYPE. The entry in the union +** for terminal symbols is called "yy0". +** YYSTACKDEPTH is the maximum depth of the parser's stack. If +** zero the stack is dynamically sized using realloc() +** 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 +** YYREALLOC Name of the realloc() function to use +** YYFREE Name of the free() function to use +** YYDYNSTACK True if stack space should be extended on heap +** 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 +** YY_MIN_DSTRCTR Minimum symbol value that has a destructor +** YY_MAX_DSTRCTR Maximum symbol value that has a destructor +*/ +#ifndef INTERFACE +# define INTERFACE 1 +#endif +/************* Begin control #defines *****************************************/ +%% +/************* 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 + +/* Macro to determine if stack space has the ability to grow using +** heap memory. +*/ +#if YYSTACKDEPTH<=0 || YYDYNSTACK +# define YYGROWABLESTACK 1 +#else +# define YYGROWABLESTACK 0 +#endif + +/* Guarantee a minimum number of initial stack slots. +*/ +#if YYSTACKDEPTH<=0 +# undef YYSTACKDEPTH +# define YYSTACKDEPTH 2 /* Need a minimum stack size */ +#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 **********************************************/ +%% +/********** 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 + ParseARG_SDECL /* A place to hold %extra_argument */ + ParseCTX_SDECL /* A place to hold %extra_context */ + yyStackEntry *yystackEnd; /* Last entry in the stack */ + yyStackEntry *yystack; /* The parser stack */ + yyStackEntry yystk0[YYSTACKDEPTH]; /* Initial stack space */ +}; +typedef struct yyParser yyParser; + +#include +#ifndef NDEBUG +#include +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: +**
    +**
  • A FILE* to which trace output should be written. +** If NULL, then tracing is turned off. +**
  • A prefix string written at the beginning of every +** line of trace output. If NULL, then tracing is +** turned off. +**
+** +** Outputs: +** None. +*/ +void ParseTrace(FILE *TraceFILE, char *zTracePrompt){ + 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[] = { +%% +}; +#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ + +#ifndef NDEBUG +/* For tracing reduce actions, the names of all rules are required. +*/ +static const char *const yyRuleName[] = { +%% +}; +#endif /* NDEBUG */ + + +#if YYGROWABLESTACK +/* +** Try to increase the size of the parser stack. Return the number +** of errors. Return 0 on success. +*/ +static int yyGrowStack(yyParser *p){ + int oldSize = 1 + (int)(p->yystackEnd - p->yystack); + int newSize; + int idx; + yyStackEntry *pNew; + + newSize = oldSize*2 + 100; + idx = (int)(p->yytos - p->yystack); + if( p->yystack==p->yystk0 ){ + pNew = YYREALLOC(0, newSize*sizeof(pNew[0])); + if( pNew==0 ) return 1; + memcpy(pNew, p->yystack, oldSize*sizeof(pNew[0])); + }else{ + pNew = YYREALLOC(p->yystack, newSize*sizeof(pNew[0])); + if( pNew==0 ) return 1; + } + p->yystack = pNew; + p->yytos = &p->yystack[idx]; +#ifndef NDEBUG + if( yyTraceFILE ){ + fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n", + yyTracePrompt, oldSize, newSize); + } +#endif + p->yystackEnd = &p->yystack[newSize-1]; + return 0; +} +#endif /* YYGROWABLESTACK */ + +#if !YYGROWABLESTACK +/* For builds that do no have a growable stack, yyGrowStack always +** returns an error. +*/ +# define yyGrowStack(X) 1 +#endif + +/* Datatype of the argument to the memory allocated passed as the +** second argument to ParseAlloc() below. This can be changed by +** 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. +*/ +void ParseInit(void *yypRawParser ParseCTX_PDECL){ + yyParser *yypParser = (yyParser*)yypRawParser; + ParseCTX_STORE +#ifdef YYTRACKMAXSTACKDEPTH + yypParser->yyhwm = 0; +#endif + yypParser->yystack = yypParser->yystk0; + yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1]; +#ifndef YYNOERRORRECOVERY + yypParser->yyerrcnt = -1; +#endif + yypParser->yytos = yypParser->yystack; + yypParser->yystack[0].stateno = 0; + yypParser->yystack[0].major = 0; +} + +#ifndef Parse_ENGINEALWAYSONSTACK +/* +** 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 +** to Parse and ParseFree. +*/ +void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){ + yyParser *yypParser; + yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); + if( yypParser ){ + ParseCTX_STORE + ParseInit(yypParser ParseCTX_PARAM); + } + return (void*)yypParser; +} +#endif /* Parse_ENGINEALWAYSONSTACK */ + + +/* 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 */ +){ + ParseARG_FETCH + ParseCTX_FETCH + 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 ***************************************/ +%% +/********* 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 +*/ +void ParseFinalize(void *p){ + yyParser *pParser = (yyParser*)p; + + /* In-lined version of calling yy_pop_parser_stack() for each + ** element left in the stack */ + yyStackEntry *yytos = pParser->yytos; + while( yytos>pParser->yystack ){ +#ifndef NDEBUG + if( yyTraceFILE ){ + fprintf(yyTraceFILE,"%sPopping %s\n", + yyTracePrompt, + yyTokenName[yytos->major]); + } +#endif + if( yytos->major>=YY_MIN_DSTRCTR ){ + yy_destructor(pParser, yytos->major, &yytos->minor); + } + yytos--; + } + +#if YYGROWABLESTACK + if( pParser->yystack!=pParser->yystk0 ) YYFREE(pParser->yystack); +#endif +} + +#ifndef Parse_ENGINEALWAYSONSTACK +/* +** 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. +*/ +void ParseFree( + void *p, /* The parser to be deleted */ + void (*freeProc)(void*) /* Function used to reclaim memory */ +){ +#ifndef YYPARSEFREENEVERNULL + if( p==0 ) return; +#endif + ParseFinalize(p); + (*freeProc)(p); +} +#endif /* Parse_ENGINEALWAYSONSTACK */ + +/* +** Return the peak depth of the stack for a parser. +*/ +#ifdef YYTRACKMAXSTACKDEPTH +int ParseStackPeak(void *p){ + 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) +int ParseCoverage(FILE *out){ + int stateno, iLookAhead, i; + int nMissed = 0; + for(stateno=0; statenoYY_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<=YY_ACTTAB_COUNT ); + assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); + assert( iLookAhead!=YYNOCODE ); + assert( iLookAhead < YYNTOKEN ); + i += iLookAhead; + assert( i<(int)YY_NLOOKAHEAD ); + if( yy_lookahead[i]!=iLookAhead ){ +#ifdef YYFALLBACK + YYCODETYPE iFallback; /* Fallback token */ + assert( iLookAhead %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; + assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) ); + if( 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{ + assert( i>=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) ); + 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 && iyytos>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 ********************************************/ + ParseARG_STORE /* Suppress warning about unused %extra_argument var */ + ParseCTX_STORE +} + +/* +** Print tracing information for a SHIFT action +*/ +#ifndef NDEBUG +static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){ + if( yyTraceFILE ){ + if( yyNewStateyytos->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 */ + ParseTOKENTYPE yyMinor /* The minor token to shift in */ +){ + 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 + yytos = yypParser->yytos; + if( yytos>yypParser->yystackEnd ){ + if( yyGrowStack(yypParser) ){ + yypParser->yytos--; + yyStackOverflow(yypParser); + return; + } + yytos = yypParser->yytos; + assert( yytos <= yypParser->yystackEnd ); + } + if( yyNewState > YY_MAX_SHIFT ){ + yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; + } + yytos->stateno = yyNewState; + yytos->major = yyMajor; + yytos->minor.yy0 = yyMinor; + yyTraceShift(yypParser, yyNewState, "Shift"); +} + +/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side +** of that rule */ +static const YYCODETYPE yyRuleInfoLhs[] = { +%% +}; + +/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number +** of symbols on the right-hand side of that rule. */ +static const signed char yyRuleInfoNRhs[] = { +%% +}; + +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 */ + ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ + ParseCTX_PDECL /* %extra_context */ +){ + 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 */ + ParseARG_FETCH + (void)yyLookahead; + (void)yyLookaheadToken; + yymsp = yypParser->yytos; + + switch( yyruleno ){ + /* Beginning here are the reduction cases. A typical example + ** follows: + ** case 0: + ** #line + ** { ... } // User supplied code + ** #line + ** break; + */ +/********** Begin reduce actions **********************************************/ +%% +/********** End reduce actions ************************************************/ + }; + assert( yyrulenoYY_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 */ +){ + ParseARG_FETCH + ParseCTX_FETCH +#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 *****************************************/ + ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ + ParseCTX_STORE +} +#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 */ + ParseTOKENTYPE yyminor /* The minor type of the error token */ +){ + ParseARG_FETCH + ParseCTX_FETCH +#define TOKEN yyminor +/************ Begin %syntax_error code ****************************************/ +%% +/************ End %syntax_error code ******************************************/ + ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ + ParseCTX_STORE +} + +/* +** The following is executed when the parser accepts +*/ +static void yy_accept( + yyParser *yypParser /* The parser */ +){ + ParseARG_FETCH + ParseCTX_FETCH +#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 *******************************************/ + ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ + ParseCTX_STORE +} + +/* The main parser program. +** The first argument is a pointer to a structure obtained from +** "ParseAlloc" which describes the current state of the parser. +** 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: +**
    +**
  • A pointer to the parser (an opaque structure.) +**
  • The major token number. +**
  • The minor token number. +**
  • An option argument of a grammar-specified type. +**
+** +** Outputs: +** None. +*/ +void Parse( + void *yyp, /* The parser */ + int yymajor, /* The major token code number */ + ParseTOKENTYPE yyminor /* The value for the token */ + ParseARG_PDECL /* Optional %extra_argument parameter */ +){ + 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 */ + ParseCTX_FETCH + ParseARG_STORE + + 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 + + while(1){ /* Exit by "break" */ + assert( yypParser->yytos>=yypParser->yystack ); + assert( yyact==yypParser->yytos->stateno ); + yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact); + if( yyact >= YY_MIN_REDUCE ){ + unsigned int yyruleno = yyact - YY_MIN_REDUCE; /* Reduce by this rule */ +#ifndef NDEBUG + assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ); + if( yyTraceFILE ){ + int yysize = yyRuleInfoNRhs[yyruleno]; + if( yysize ){ + fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", + yyTracePrompt, + yyruleno, yyRuleName[yyruleno], + yyrulenoyytos[yysize].stateno); + }else{ + fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n", + yyTracePrompt, yyruleno, yyRuleName[yyruleno], + yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){ + yypParser->yyhwm++; + assert( yypParser->yyhwm == + (int)(yypParser->yytos - yypParser->yystack)); + } +#endif + if( yypParser->yytos>=yypParser->yystackEnd ){ + if( yyGrowStack(yypParser) ){ + yyStackOverflow(yypParser); + break; + } + } + } + yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor ParseCTX_PARAM); + }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); + if( yyact<=YY_MAX_SHIFTREDUCE ) break; + 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 + } + } +#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. +*/ +int ParseFallback(int iToken){ +#ifdef YYFALLBACK + assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ); + return yyFallback[iToken]; +#else + (void)iToken; + return 0; +#endif +} diff --git a/docs/zh/14-reference/01-components/06-taoskeeper.md b/docs/zh/14-reference/01-components/06-taoskeeper.md index c3d22d25f1..00b1f1ee51 100644 --- a/docs/zh/14-reference/01-components/06-taoskeeper.md +++ b/docs/zh/14-reference/01-components/06-taoskeeper.md @@ -13,7 +13,7 @@ taosKeeper 是 TDengine 3.0 版本监控指标的导出工具,通过简单的 taosKeeper 有两种安装方式: -- 安装 TDengine 官方安装包的同时会自动安装 taosKeeper, 详情请参考[ TDengine 安装](../../../get-started/)。 +- 安装 TDengine 官方安装包的同时会自动安装 taosKeeper, 详情请参考[TDengine 安装](../../../get-started/)。 - 单独编译 taosKeeper 并安装,详情请参考 [taosKeeper](https://github.com/taosdata/taoskeeper) 仓库。 @@ -22,55 +22,64 @@ taosKeeper 有两种安装方式: taosKeeper 需要在操作系统终端执行,该工具支持三种配置方式:命令行参数、环境变量 和 配置文件。优先级为:命令行参数、环境变量、配置文件参数。 一般我们推荐使用配置文件。 ### 命令行参数和环境变量 + 命令行参数 和 环境变量说明可以参考命令 `taoskeeper --help` 的输出。下面是一个例子: + ```shell -Usage of taosKeeper v3.3.2.0: - --debug enable debug mode. Env "TAOS_KEEPER_DEBUG" - -P, --port int http port. Env "TAOS_KEEPER_PORT" (default 6043) - --logLevel string log level (panic fatal error warn warning info debug trace). Env "TAOS_KEEPER_LOG_LEVEL" (default "info") - --gopoolsize int coroutine size. Env "TAOS_KEEPER_POOL_SIZE" (default 50000) - -R, --RotationInterval string interval for refresh metrics, such as "300ms", Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". Env "TAOS_KEEPER_ROTATION_INTERVAL" (default "15s") - --tdengine.host string TDengine server's ip. Env "TAOS_KEEPER_TDENGINE_HOST" (default "127.0.0.1") - --tdengine.port int TDengine REST server(taosAdapter)'s port. Env "TAOS_KEEPER_TDENGINE_PORT" (default 6041) - --tdengine.username string TDengine server's username. Env "TAOS_KEEPER_TDENGINE_USERNAME" (default "root") - --tdengine.password string TDengine server's password. Env "TAOS_KEEPER_TDENGINE_PASSWORD" (default "taosdata") - --tdengine.usessl TDengine server use ssl or not. Env "TAOS_KEEPER_TDENGINE_USESSL" - --metrics.prefix string prefix in metrics names. Env "TAOS_KEEPER_METRICS_PREFIX" - --metrics.database.name string database for storing metrics data. Env "TAOS_KEEPER_METRICS_DATABASE" (default "log") - --metrics.tables stringArray export some tables that are not super table, multiple values split with white space. Env "TAOS_KEEPER_METRICS_TABLES" - --environment.incgroup whether running in cgroup. Env "TAOS_KEEPER_ENVIRONMENT_INCGROUP" - --log.path string log path. Env "TAOS_KEEPER_LOG_PATH" (default "/var/log/taos") - --log.rotationCount uint log rotation count. Env "TAOS_KEEPER_LOG_ROTATION_COUNT" (default 5) - --log.rotationTime duration log rotation time. Env "TAOS_KEEPER_LOG_ROTATION_TIME" (default 24h0m0s) - --log.rotationSize string log rotation size(KB MB GB), must be a positive integer. Env "TAOS_KEEPER_LOG_ROTATION_SIZE" (default "100000000") - -c, --config string config path default /etc/taos/taoskeeper.toml - -V, --version Print the version and exit - -h, --help Print this help message and exit +Usage of taoskeeper v3.3.3.0: + -R, --RotationInterval string interval for refresh metrics, such as "300ms", Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". Env "TAOS_KEEPER_ROTATION_INTERVAL" (default "15s") + -c, --config string config path default /etc/taos/taoskeeper.toml + --drop string run taoskeeper in command mode, only support old_taosd_metric_stables. + --environment.incgroup whether running in cgroup. Env "TAOS_KEEPER_ENVIRONMENT_INCGROUP" + --fromTime string parameter of transfer, example: 2020-01-01T00:00:00+08:00 (default "2020-01-01T00:00:00+08:00") + --gopoolsize int coroutine size. Env "TAOS_KEEPER_POOL_SIZE" (default 50000) + -h, --help Print this help message and exit + --instanceId int instance ID. Env "TAOS_KEEPER_INSTANCE_ID" (default 64) + --log.compress whether to compress old log. Env "TAOS_KEEPER_LOG_COMPRESS" + --log.keepDays uint log retention days, must be a positive integer. Env "TAOS_KEEPER_LOG_KEEP_DAYS" (default 30) + --log.level string log level (trace debug info warning error). Env "TAOS_KEEPER_LOG_LEVEL" (default "info") + --log.path string log path. Env "TAOS_KEEPER_LOG_PATH" (default "/var/log/taos") + --log.reservedDiskSize string reserved disk size for log dir (KB MB GB), must be a positive integer. Env "TAOS_KEEPER_LOG_RESERVED_DISK_SIZE" (default "1GB") + --log.rotationCount uint log rotation count. Env "TAOS_KEEPER_LOG_ROTATION_COUNT" (default 5) + --log.rotationSize string log rotation size(KB MB GB), must be a positive integer. Env "TAOS_KEEPER_LOG_ROTATION_SIZE" (default "1GB") + --log.rotationTime duration deprecated: log rotation time always 24 hours. Env "TAOS_KEEPER_LOG_ROTATION_TIME" (default 24h0m0s) + --logLevel string log level (trace debug info warning error). Env "TAOS_KEEPER_LOG_LEVEL" (default "info") + --metrics.database.name string database for storing metrics data. Env "TAOS_KEEPER_METRICS_DATABASE" (default "log") + --metrics.database.options.buffer int database option buffer for audit database. Env "TAOS_KEEPER_METRICS_BUFFER" (default 64) + --metrics.database.options.cachemodel string database option cachemodel for audit database. Env "TAOS_KEEPER_METRICS_CACHEMODEL" (default "both") + --metrics.database.options.keep int database option buffer for audit database. Env "TAOS_KEEPER_METRICS_KEEP" (default 90) + --metrics.database.options.vgroups int database option vgroups for audit database. Env "TAOS_KEEPER_METRICS_VGROUPS" (default 1) + --metrics.prefix string prefix in metrics names. Env "TAOS_KEEPER_METRICS_PREFIX" + --metrics.tables stringArray export some tables that are not super table, multiple values split with white space. Env "TAOS_KEEPER_METRICS_TABLES" + -P, --port int http port. Env "TAOS_KEEPER_PORT" (default 6043) + --tdengine.host string TDengine server's ip. Env "TAOS_KEEPER_TDENGINE_HOST" (default "127.0.0.1") + --tdengine.password string TDengine server's password. Env "TAOS_KEEPER_TDENGINE_PASSWORD" (default "taosdata") + --tdengine.port int TDengine REST server(taosAdapter)'s port. Env "TAOS_KEEPER_TDENGINE_PORT" (default 6041) + --tdengine.username string TDengine server's username. Env "TAOS_KEEPER_TDENGINE_USERNAME" (default "root") + --tdengine.usessl TDengine server use ssl or not. Env "TAOS_KEEPER_TDENGINE_USESSL" + --transfer string run taoskeeper in command mode, only support old_taosd_metric. transfer old metrics data to new tables and exit + -V, --version Print the version and exit ``` - - ### 配置文件 -taosKeeper 支持用 `taoskeeper -c ` 命令来指定配置文件。 -若不指定配置文件,taosKeeper 会使用默认配置文件,其路径为: `/etc/taos/taoskeeper.toml` 。 +taosKeeper 支持用 `taoskeeper -c ` 命令来指定配置文件。 +若不指定配置文件,taosKeeper 会使用默认配置文件,其路径为: `/etc/taos/taoskeeper.toml` 。 若既不指定 taosKeeper 配置文件,且 `/etc/taos/taoskeeper.toml` 也不存在,将使用默认配置。 **下面是配置文件的示例:** -```toml -# Start with debug middleware for gin -debug = false -# Listen port, default is 6043 +```toml +# The ID of the currently running taoskeeper instance, default is 64. +instanceId = 64 + +# Listening port, default is 6043. port = 6043 -# log level -loglevel = "info" - -# go pool size +# Go pool size gopoolsize = 50000 -# interval for metrics +# Interval for metrics RotationInterval = "15s" [tdengine] @@ -81,20 +90,21 @@ password = "taosdata" usessl = false [metrics] -# metrics prefix in metrics names. +# Metrics prefix in metrics names. prefix = "taos" -# export some tables that are not super table +# Export some tables that are not super table. tables = [] -# database for storing metrics data +# Database for storing metrics data. [metrics.database] name = "log" -# database options for db storing metrics data + +# Database options for db storing metrics data. [metrics.database.options] vgroups = 1 buffer = 64 -KEEP = 90 +keep = 90 cachemodel = "both" [environment] @@ -102,9 +112,19 @@ cachemodel = "both" incgroup = false [log] -rotationCount = 5 -rotationTime = "24h" -rotationSize = 100000000 +# The directory where log files are stored. +# path = "/var/log/taos" +level = "info" +# Number of log file rotations before deletion. +rotationCount = 30 +# The number of days to retain log files. +keepDays = 30 +# The maximum size of a log file before rotation. +rotationSize = "1GB" +# If set to true, log files will be compressed. +compress = false +# Minimum disk space to reserve. Log files will not be written if disk space falls below this limit. +reservedDiskSize = "1GB" ``` ## 启动 @@ -118,7 +138,6 @@ monitorFqdn localhost # taoskeeper 服务的 FQDN TDengine 监控配置相关,具体请参考:[TDengine 监控配置](../../../operation/monitor)。 - @@ -188,8 +207,7 @@ Active: inactive (dead) - -## 健康检查 +## 健康检查 可以访问 taosKeeper 的 `check_health` 接口来判断服务是否存活,如果服务正常则会返回 HTTP 200 状态码: @@ -208,7 +226,6 @@ Content-Length: 21 {"version":"3.3.2.3"} ``` - ## 数据收集与监控 taosKeeper 作为 TDengine 监控指标的导出工具,可以将 TDengine 产生的监控数据记录在指定数据库中(默认的监控数据是 `log`),这些监控数据可以用来配置 TDengine 监控。 @@ -216,6 +233,7 @@ taosKeeper 作为 TDengine 监控指标的导出工具,可以将 TDengine 产 ### 查看监控数据 可以查看 `log` 库下的超级表,每个超级表都对应一组监控指标,具体指标不再赘述。 + ```shell taos> use log; Database changed. @@ -251,17 +269,14 @@ taos> select last_row(*) from taosd_dnodes_info; Query OK, 1 row(s) in set (0.003168s) ``` - ### 使用 TDInsight 配置监控 -收集到监控数据以后,就可以使用 TDInsight 来配置 TDengine 的监控,具体请参考 [TDinsight 参考手册](../tdinsight/) - +收集到监控数据以后,就可以使用 TDInsight 来配置 TDengine 的监控,具体请参考 [TDinsight 参考手册](../tdinsight/)。 ## 集成 Prometheus taoskeeper 提供了 `/metrics` 接口,返回了 Prometheus 格式的监控数据,Prometheus 可以从 taoskeeper 抽取监控数据,实现通过 Prometheus 监控 TDengine 的目的。 - ### 导出监控指标 下面通过 `curl` 命令展示 `/metrics` 接口返回的数据格式: @@ -298,9 +313,11 @@ taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1 #### taosd 集群 ##### 监控信息支持的标签 + - `cluster_id`: 集群 id ##### 相关指标及其含义 + | 指标名称 | 类型 | 含义 | | ----------------------------------- | ------- | ------------------------------------- | | taos_cluster_info_connections_total | counter | 总连接数 | @@ -328,11 +345,13 @@ taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1 #### dnode ##### 监控信息支持的标签 + - `cluster_id`: 集群 id - `dnode_ep`: dnode 端点 - `dnode_id`:dnode id ##### 相关指标及其含义 + | 指标名称 | 类型 | 含义 | | ------------------------------ | ------- | ---------------------------------------------------------------------------------------- | | taos_d_info_status | gauge | dnode 状态,标签 value 表示状态, ready 表示正常, offline 表示下线, unknown 表示未知。 | @@ -361,13 +380,15 @@ taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1 #### 数据目录 ##### 监控信息支持的标签 + - `cluster_id`: 集群 id - `dnode_ep`: dnode 端点 - `dnode_id`:dnode id - `data_dir_name`:数据目录名 -- `data_dir_level`:数据目录级别 +- `data_dir_level`:数据目录级别 ##### 相关指标及其含义 + | 指标名称 | 类型 | 含义 | | --------------------------------- | ----- | -------------------- | | taos_taosd_dnodes_data_dirs_avail | gauge | 可用空间(单位 Byte) | @@ -377,12 +398,14 @@ taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1 #### 日志目录 ##### 监控信息支持的标签 + - `cluster_id`: 集群 id - `dnode_ep`: dnode 端点 - `dnode_id`:dnode id - `log_dir_name`:日志目录名 ##### 相关指标及其含义 + | 指标名称 | 类型 | 含义 | | -------------------------------- | ----- | -------------------- | | taos_taosd_dnodes_log_dirs_avail | gauge | 可用空间(单位 Byte) | @@ -392,11 +415,13 @@ taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1 #### 日志数量 ##### 监控信息支持的标签 + - `cluster_id`: 集群 id - `dnode_ep`: dnode 端点 - `dnode_id`:dnode id ##### 相关指标及其含义 + | 指标名称 | 类型 | 含义 | | ---------------------- | ------- | ------------ | | taos_log_summary_debug | counter | 调试日志数量 | @@ -404,14 +429,15 @@ taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1 | taos_log_summary_info | counter | 信息日志数量 | | taos_log_summary_trace | counter | 跟踪日志数量 | - #### taosadapter ##### 监控信息支持的标签 + - `endpoint`:端点 - `req_type`:请求类型,0 表示 rest,1 表示 websocket ##### 相关指标及其含义 + | 指标名称 | 类型 | 含义 | | -------------------------------------- | ------- | -------------------- | | taos_adapter_requests_fail | counter | 失败的请求数 | @@ -433,9 +459,11 @@ taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1 #### taoskeeper ##### 监控信息支持的标签 + - `identify`: 节点 endpoint ##### 相关指标及其含义 + | 指标名称 | 类型 | 含义 | | ----------------------- | ----- | ------------------------------------- | | taos_keeper_monitor_cpu | gauge | taoskeeper CPU 使用率(取值范围 0~1) | @@ -444,6 +472,7 @@ taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1 #### 其他 taosd 集群监控项 ##### taos_m_info_role + - **标签**: - `cluster_id`: 集群 id - `mnode_ep`: mnode 端点 @@ -453,6 +482,7 @@ taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1 - **含义**: mnode 角色 ##### taos_taos_sql_req_count + - **标签**: - `cluster_id`: 集群 id - `result`: 请求结果(取值范围: Success, Failed) @@ -462,6 +492,7 @@ taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1 - **含义**: SQL 请求数量 ##### taos_taosd_sql_req_count + - **标签**: - `cluster_id`: 集群 id - `dnode_ep`: dnode 端点 @@ -474,6 +505,7 @@ taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1 - **含义**: SQL 请求数量 ##### taos_taosd_vgroups_info_status + - **标签**: - `cluster_id`: 集群 id - `database_name`: 数据库名称 @@ -482,6 +514,7 @@ taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1 - **含义**: 虚拟组状态。 0 为 unsynced,表示没有leader选出;1 为 ready。 ##### taos_taosd_vgroups_info_tables_num + - **标签**: - `cluster_id`: 集群 id - `database_name`: 数据库名称 @@ -490,6 +523,7 @@ taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1 - **含义**: 虚拟组表数量 ##### taos_taosd_vnodes_info_role + - **标签**: - `cluster_id`: 集群 id - `database_name`: 数据库名称 @@ -499,7 +533,6 @@ taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1 - **类型**: gauge - **含义**: 虚拟节点角色 - ### 抽取配置 Prometheus 提供了 `scrape_configs` 配置如何从 endpoint 抽取监控数据,通常只需要修改 `static_configs` 中的 targets 配置为 taoskeeper 的 endpoint 地址,更多配置信息请参考 [Prometheus 配置文档](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config)。 @@ -521,8 +554,6 @@ scrape_configs: 在 Grafana Dashboard 菜单点击 `import`,dashboard ID 填写 `18587`,点击 `Load` 按钮即可导入 `TaosKeeper Prometheus Dashboard for 3.x` dashboard。 - - ## taosKeeper 监控指标 taosKeeper 也会将自己采集的监控数据写入监控数据库,默认是 `log` 库,可以在 taoskeeper 配置文件中修改。 diff --git a/docs/zh/14-reference/03-taos-sql/10-function.md b/docs/zh/14-reference/03-taos-sql/10-function.md index dd58adfeed..bbc6a0b81a 100644 --- a/docs/zh/14-reference/03-taos-sql/10-function.md +++ b/docs/zh/14-reference/03-taos-sql/10-function.md @@ -1569,7 +1569,7 @@ COUNT({* | expr}) ELAPSED(ts_primary_key [, time_unit]) ``` -**功能说明**:elapsed函数表达了统计周期内连续的时间长度,和twa函数配合使用可以计算统计曲线下的面积。在通过INTERVAL子句指定窗口的情况下,统计在给定时间范围内的每个窗口内有数据覆盖的时间范围;如果没有INTERVAL子句,则返回整个给定时间范围内的有数据覆盖的时间范围。注意,ELAPSED返回的并不是时间范围的绝对值,而是绝对值除以time_unit所得到的单位个数。流计算仅在FORCE_WINDOW_CLOSE模式下支持该函数。 +**功能说明**:elapsed 函数表达了统计周期内连续的时间长度,和 twa 函数配合使用可以计算统计曲线下的面积。在通过 INTERVAL 子句指定窗口的情况下,统计在给定时间范围内的每个窗口内有数据覆盖的时间范围;如果没有 INTERVAL 子句,则返回整个给定时间范围内的有数据覆盖的时间范围。注意,ELAPSED 返回的并不是时间范围的绝对值,而是绝对值除以 time_unit 所得到的单位个数。流计算仅在 FORCE_WINDOW_CLOSE 模式下支持该函数。 **返回结果类型**:DOUBLE。 @@ -1578,15 +1578,15 @@ ELAPSED(ts_primary_key [, time_unit]) **适用于**: 表,超级表,嵌套查询的外层查询 **说明**: -- ts_primary_key参数只能是表的第一列,即 TIMESTAMP 类型的主键列。 -- 按time_unit参数指定的时间单位返回,最小是数据库的时间分辨率。time_unit 参数未指定时,以数据库的时间分辨率为时间单位。支持的时间单位 time_unit 如下: +- ts_primary_key 参数只能是表的第一列,即 TIMESTAMP 类型的主键列。 +- 按 time_unit 参数指定的时间单位返回,最小是数据库的时间分辨率。time_unit 参数未指定时,以数据库的时间分辨率为时间单位。支持的时间单位 time_unit 如下: 1b(纳秒), 1u(微秒),1a(毫秒),1s(秒),1m(分),1h(小时),1d(天), 1w(周)。 -- 可以和interval组合使用,返回每个时间窗口的时间戳差值。需要特别注意的是,除第一个时间窗口和最后一个时间窗口外,中间窗口的时间戳差值均为窗口长度。 -- order by asc/desc不影响差值的计算结果。 -- 对于超级表,需要和group by tbname子句组合使用,不可以直接使用。 -- 对于普通表,不支持和group by子句组合使用。 -- 对于嵌套查询,仅当内层查询会输出隐式时间戳列时有效。例如select elapsed(ts) from (select diff(value) from sub1)语句,diff函数会让内层查询输出隐式时间戳列,此为主键列,可以用于elapsed函数的第一个参数。相反,例如select elapsed(ts) from (select * from sub1) 语句,ts列输出到外层时已经没有了主键列的含义,无法使用elapsed函数。此外,elapsed函数作为一个与时间线强依赖的函数,形如select elapsed(ts) from (select diff(value) from st group by tbname)尽管会返回一条计算结果,但并无实际意义,这种用法后续也将被限制。 -- 不支持与leastsquares、diff、derivative、top、bottom、last_row、interp等函数混合使用。 +- 可以和 interval 组合使用,返回每个时间窗口的时间戳差值。需要特别注意的是,除第一个时间窗口和最后一个时间窗口外,中间窗口的时间戳差值均为窗口长度。 +- order by asc/desc 不影响差值的计算结果。 +- 对于超级表,需要和 group by tbname 子句组合使用,不可以直接使用。 +- 对于普通表,不支持和 group by 子句组合使用。 +- 对于嵌套查询,仅当内层查询会输出隐式时间戳列时有效。例如 select elapsed(ts) from (select diff(value) from sub1) 语句,diff 函数会让内层查询输出隐式时间戳列,此为主键列,可以用于 elapsed 函数的第一个参数。相反,例如 select elapsed(ts) from (select * from sub1) 语句,ts 列输出到外层时已经没有了主键列的含义,无法使用 elapsed 函数。此外,elapsed 函数作为一个与时间线强依赖的函数,形如 select elapsed(ts) from (select diff(value) from st group by tbname)尽 管会返回一条计算结果,但并无实际意义,这种用法后续也将被限制。 +- 不支持与 leastsquares、diff、derivative、top、bottom、last_row、interp 等函数混合使用。 ### LEASTSQUARES @@ -1829,14 +1829,14 @@ ignore_null_values: { - INTERP 用于在指定时间断面获取指定列的记录值,如果该时间断面不存在符合条件的行数据,那么会根据 FILL 参数的设定进行插值。 - INTERP 的输入数据为指定列的数据,可以通过条件语句(where 子句)来对原始列数据进行过滤,如果没有指定过滤条件则输入为全部数据。 -- INTERP SQL查询需要同时与 RANGE,EVERY 和 FILL 关键字一起使用;流计算不能使用RANGE,需要EVERY 和 FILL 关键字一起使用。 -- INTERP 的输出时间范围根据 RANGE(timestamp1, timestamp2)字段来指定,需满足 timestamp1 \<= timestamp2。其中 timestamp1 为输出时间范围的起始值,即如果 timestamp1 时刻符合插值条件则 timestamp1 为输出的第一条记录,timestamp2 为输出时间范围的结束值,即输出的最后一条记录的 timestamp 不能大于 timestamp2。 +- INTERP SQL 查询需要同时与 RANGE,EVERY 和 FILL 关键字一起使用;流计算不能使用 RANGE,需要 EVERY 和 FILL 关键字一起使用。 +- INTERP 的输出时间范围根据 RANGE(timestamp1, timestamp2) 字段来指定,需满足 timestamp1 \<= timestamp2。其中 timestamp1 为输出时间范围的起始值,即如果 timestamp1 时刻符合插值条件则 timestamp1 为输出的第一条记录,timestamp2 为输出时间范围的结束值,即输出的最后一条记录的 timestamp 不能大于 timestamp2。 - INTERP 根据 EVERY(time_unit) 字段来确定输出时间范围内的结果条数,即从 timestamp1 开始每隔固定长度的时间(time_unit 值)进行插值,time_unit 可取值时间单位:1a(毫秒),1s(秒),1m(分),1h(小时),1d(天),1w(周)。例如 EVERY(500a) 将对于指定数据每500毫秒间隔进行一次插值. - INTERP 根据 FILL 字段来决定在每个符合输出条件的时刻如何进行插值。关于 FILL 子句如何使用请参考 [FILL 子句](../distinguished/#fill-子句) - INTERP 可以在 RANGE 字段中只指定唯一的时间戳对单个时间点进行插值,在这种情况下,EVERY 字段可以省略。例如:SELECT INTERP(col) FROM tb RANGE('2023-01-01 00:00:00') FILL(linear). - INTERP 作用于超级表时, 会将该超级表下的所有子表数据按照主键列排序后进行插值计算,也可以搭配 PARTITION BY tbname 使用,将结果强制规约到单个时间线。 -- INTERP 可以与伪列 _irowts 一起使用,返回插值点所对应的时间戳(3.0.2.0版本以后支持)。 -- INTERP 可以与伪列 _isfilled 一起使用,显示返回结果是否为原始记录或插值算法产生的数据(3.0.3.0版本以后支持)。 +- INTERP 可以与伪列 _irowts 一起使用,返回插值点所对应的时间戳(3.0.2.0 版本以后支持)。 +- INTERP 可以与伪列 _isfilled 一起使用,显示返回结果是否为原始记录或插值算法产生的数据(3.0.3.0 版本以后支持)。 - INTERP 对于带复合主键的表的查询,若存在相同时间戳的数据,则只有对应的复合主键最小的数据参与运算。 ### LAST @@ -2180,7 +2180,7 @@ STATEDURATION(expr, oper, val, unit) TWA(expr) ``` -**功能说明**:时间加权平均函数。统计表中某列在一段时间内的时间加权平均。对于存在复合主键的表的查询,若时间戳相同的数据存在多条,则只有对应的复合主键最小的数据参与运算。流计算仅在FORCE_WINDOW_CLOSE模式下支持该函数。 +**功能说明**:时间加权平均函数。统计表中某列在一段时间内的时间加权平均。对于存在复合主键的表的查询,若时间戳相同的数据存在多条,则只有对应的复合主键最小的数据参与运算。流计算仅在 FORCE_WINDOW_CLOSE 模式下支持该函数。 **返回数据类型**:DOUBLE。 diff --git a/docs/zh/14-reference/03-taos-sql/14-stream.md b/docs/zh/14-reference/03-taos-sql/14-stream.md index 25a11ecdcb..0470ebf630 100644 --- a/docs/zh/14-reference/03-taos-sql/14-stream.md +++ b/docs/zh/14-reference/03-taos-sql/14-stream.md @@ -150,7 +150,7 @@ SELECT * from information_schema.`ins_streams`; 2. WINDOW_CLOSE:窗口关闭时触发(窗口关闭由事件时间决定,可配合 watermark 使用) 3. MAX_DELAY time:若窗口关闭,则触发计算。若窗口未关闭,且未关闭时长超过 max delay 指定的时间,则触发计算。 -4. FORCE_WINDOW_CLOSE:以操作系统当前时间为准,只计算当前关闭窗口的结果,并推送出去。窗口只会在被关闭的时刻计算一次,后续不会再重复计算。该模式当前只支持 INTERVAL 窗口(不支持滑动);FILL_HISTORY必须为 0,IGNORE EXPIRED 必须为 1,IGNORE UPDATE 必须为 1;FILL 只支持PREV 、NULL、 NONE、VALUE。 +4. FORCE_WINDOW_CLOSE:以操作系统当前时间为准,只计算当前关闭窗口的结果,并推送出去。窗口只会在被关闭的时刻计算一次,后续不会再重复计算。该模式当前只支持 INTERVAL 窗口(不支持滑动);FILL_HISTORY 必须为 0,IGNORE EXPIRED 必须为 1,IGNORE UPDATE 必须为 1;FILL 只支持 PREV 、NULL、NONE、VALUE。 由于窗口关闭是由事件时间决定的,如事件流中断、或持续延迟,则事件时间无法更新,可能导致无法得到最新的计算结果。 @@ -249,8 +249,11 @@ T = 最新事件时间 - DELETE_MARK - [percentile](../function/#percentile) - [top](../function/#top) - [bottom](../function/#bottom) +- [elapsed](../function/#elapsed) +- [interp](../function/#interp) - [derivative](../function/#derivative) - [irate](../function/#irate) +- [twa](../function/#twa) - [histogram](../function/#histogram) - [diff](../function/#diff) - [statecount](../function/#statecount) diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index e123b93f5c..e5e40f225e 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -16,396 +16,7 @@ #ifndef _TD_COMMON_TOKEN_H_ #define _TD_COMMON_TOKEN_H_ -#define TK_OR 1 -#define TK_AND 2 -#define TK_UNION 3 -#define TK_ALL 4 -#define TK_MINUS 5 -#define TK_EXCEPT 6 -#define TK_INTERSECT 7 -#define TK_NK_BITAND 8 -#define TK_NK_BITOR 9 -#define TK_NK_LSHIFT 10 -#define TK_NK_RSHIFT 11 -#define TK_NK_PLUS 12 -#define TK_NK_MINUS 13 -#define TK_NK_STAR 14 -#define TK_NK_SLASH 15 -#define TK_NK_REM 16 -#define TK_NK_CONCAT 17 -#define TK_CREATE 18 -#define TK_ACCOUNT 19 -#define TK_NK_ID 20 -#define TK_PASS 21 -#define TK_NK_STRING 22 -#define TK_ALTER 23 -#define TK_PPS 24 -#define TK_TSERIES 25 -#define TK_STORAGE 26 -#define TK_STREAMS 27 -#define TK_QTIME 28 -#define TK_DBS 29 -#define TK_USERS 30 -#define TK_CONNS 31 -#define TK_STATE 32 -#define TK_NK_COMMA 33 -#define TK_HOST 34 -#define TK_IS_IMPORT 35 -#define TK_NK_INTEGER 36 -#define TK_CREATEDB 37 -#define TK_USER 38 -#define TK_ENABLE 39 -#define TK_SYSINFO 40 -#define TK_ADD 41 -#define TK_DROP 42 -#define TK_GRANT 43 -#define TK_ON 44 -#define TK_TO 45 -#define TK_REVOKE 46 -#define TK_FROM 47 -#define TK_SUBSCRIBE 48 -#define TK_READ 49 -#define TK_WRITE 50 -#define TK_NK_DOT 51 -#define TK_WITH 52 -#define TK_ENCRYPT_KEY 53 -#define TK_ANODE 54 -#define TK_UPDATE 55 -#define TK_ANODES 56 -#define TK_DNODE 57 -#define TK_PORT 58 -#define TK_DNODES 59 -#define TK_RESTORE 60 -#define TK_NK_IPTOKEN 61 -#define TK_FORCE 62 -#define TK_UNSAFE 63 -#define TK_CLUSTER 64 -#define TK_LOCAL 65 -#define TK_QNODE 66 -#define TK_BNODE 67 -#define TK_SNODE 68 -#define TK_MNODE 69 -#define TK_VNODE 70 -#define TK_DATABASE 71 -#define TK_USE 72 -#define TK_FLUSH 73 -#define TK_TRIM 74 -#define TK_S3MIGRATE 75 -#define TK_COMPACT 76 -#define TK_IF 77 -#define TK_NOT 78 -#define TK_EXISTS 79 -#define TK_BUFFER 80 -#define TK_CACHEMODEL 81 -#define TK_CACHESIZE 82 -#define TK_COMP 83 -#define TK_DURATION 84 -#define TK_NK_VARIABLE 85 -#define TK_MAXROWS 86 -#define TK_MINROWS 87 -#define TK_KEEP 88 -#define TK_PAGES 89 -#define TK_PAGESIZE 90 -#define TK_TSDB_PAGESIZE 91 -#define TK_PRECISION 92 -#define TK_REPLICA 93 -#define TK_VGROUPS 94 -#define TK_SINGLE_STABLE 95 -#define TK_RETENTIONS 96 -#define TK_SCHEMALESS 97 -#define TK_WAL_LEVEL 98 -#define TK_WAL_FSYNC_PERIOD 99 -#define TK_WAL_RETENTION_PERIOD 100 -#define TK_WAL_RETENTION_SIZE 101 -#define TK_WAL_ROLL_PERIOD 102 -#define TK_WAL_SEGMENT_SIZE 103 -#define TK_STT_TRIGGER 104 -#define TK_TABLE_PREFIX 105 -#define TK_TABLE_SUFFIX 106 -#define TK_S3_CHUNKPAGES 107 -#define TK_S3_KEEPLOCAL 108 -#define TK_S3_COMPACT 109 -#define TK_KEEP_TIME_OFFSET 110 -#define TK_ENCRYPT_ALGORITHM 111 -#define TK_NK_COLON 112 -#define TK_BWLIMIT 113 -#define TK_START 114 -#define TK_TIMESTAMP 115 -#define TK_END 116 -#define TK_TABLE 117 -#define TK_NK_LP 118 -#define TK_NK_RP 119 -#define TK_USING 120 -#define TK_FILE 121 -#define TK_STABLE 122 -#define TK_COLUMN 123 -#define TK_MODIFY 124 -#define TK_RENAME 125 -#define TK_TAG 126 -#define TK_SET 127 -#define TK_NK_EQ 128 -#define TK_TAGS 129 -#define TK_BOOL 130 -#define TK_TINYINT 131 -#define TK_SMALLINT 132 -#define TK_INT 133 -#define TK_INTEGER 134 -#define TK_BIGINT 135 -#define TK_FLOAT 136 -#define TK_DOUBLE 137 -#define TK_BINARY 138 -#define TK_NCHAR 139 -#define TK_UNSIGNED 140 -#define TK_JSON 141 -#define TK_VARCHAR 142 -#define TK_MEDIUMBLOB 143 -#define TK_BLOB 144 -#define TK_VARBINARY 145 -#define TK_GEOMETRY 146 -#define TK_DECIMAL 147 -#define TK_COMMENT 148 -#define TK_MAX_DELAY 149 -#define TK_WATERMARK 150 -#define TK_ROLLUP 151 -#define TK_TTL 152 -#define TK_SMA 153 -#define TK_DELETE_MARK 154 -#define TK_FIRST 155 -#define TK_LAST 156 -#define TK_SHOW 157 -#define TK_FULL 158 -#define TK_PRIVILEGES 159 -#define TK_DATABASES 160 -#define TK_TABLES 161 -#define TK_STABLES 162 -#define TK_MNODES 163 -#define TK_QNODES 164 -#define TK_ARBGROUPS 165 -#define TK_FUNCTIONS 166 -#define TK_INDEXES 167 -#define TK_ACCOUNTS 168 -#define TK_APPS 169 -#define TK_CONNECTIONS 170 -#define TK_LICENCES 171 -#define TK_GRANTS 172 -#define TK_LOGS 173 -#define TK_MACHINES 174 -#define TK_ENCRYPTIONS 175 -#define TK_QUERIES 176 -#define TK_SCORES 177 -#define TK_TOPICS 178 -#define TK_VARIABLES 179 -#define TK_BNODES 180 -#define TK_SNODES 181 -#define TK_TRANSACTIONS 182 -#define TK_DISTRIBUTED 183 -#define TK_CONSUMERS 184 -#define TK_SUBSCRIPTIONS 185 -#define TK_VNODES 186 -#define TK_ALIVE 187 -#define TK_VIEWS 188 -#define TK_VIEW 189 -#define TK_COMPACTS 190 -#define TK_NORMAL 191 -#define TK_CHILD 192 -#define TK_LIKE 193 -#define TK_TBNAME 194 -#define TK_QTAGS 195 -#define TK_AS 196 -#define TK_SYSTEM 197 -#define TK_TSMA 198 -#define TK_INTERVAL 199 -#define TK_RECURSIVE 200 -#define TK_TSMAS 201 -#define TK_FUNCTION 202 -#define TK_INDEX 203 -#define TK_COUNT 204 -#define TK_LAST_ROW 205 -#define TK_META 206 -#define TK_ONLY 207 -#define TK_TOPIC 208 -#define TK_CONSUMER 209 -#define TK_GROUP 210 -#define TK_DESC 211 -#define TK_DESCRIBE 212 -#define TK_RESET 213 -#define TK_QUERY 214 -#define TK_CACHE 215 -#define TK_EXPLAIN 216 -#define TK_ANALYZE 217 -#define TK_VERBOSE 218 -#define TK_NK_BOOL 219 -#define TK_RATIO 220 -#define TK_NK_FLOAT 221 -#define TK_OUTPUTTYPE 222 -#define TK_AGGREGATE 223 -#define TK_BUFSIZE 224 -#define TK_LANGUAGE 225 -#define TK_REPLACE 226 -#define TK_STREAM 227 -#define TK_INTO 228 -#define TK_PAUSE 229 -#define TK_RESUME 230 -#define TK_PRIMARY 231 -#define TK_KEY 232 -#define TK_TRIGGER 233 -#define TK_AT_ONCE 234 -#define TK_WINDOW_CLOSE 235 -#define TK_FORCE_WINDOW_CLOSE 236 -#define TK_IGNORE 237 -#define TK_EXPIRED 238 -#define TK_FILL_HISTORY 239 -#define TK_SUBTABLE 240 -#define TK_UNTREATED 241 -#define TK_KILL 242 -#define TK_CONNECTION 243 -#define TK_TRANSACTION 244 -#define TK_BALANCE 245 -#define TK_VGROUP 246 -#define TK_LEADER 247 -#define TK_MERGE 248 -#define TK_REDISTRIBUTE 249 -#define TK_SPLIT 250 -#define TK_DELETE 251 -#define TK_INSERT 252 -#define TK_NK_BIN 253 -#define TK_NK_HEX 254 -#define TK_NULL 255 -#define TK_NK_QUESTION 256 -#define TK_NK_ALIAS 257 -#define TK_NK_ARROW 258 -#define TK_ROWTS 259 -#define TK_QSTART 260 -#define TK_QEND 261 -#define TK_QDURATION 262 -#define TK_WSTART 263 -#define TK_WEND 264 -#define TK_WDURATION 265 -#define TK_IROWTS 266 -#define TK_ISFILLED 267 -#define TK_FLOW 268 -#define TK_FHIGH 269 -#define TK_FROWTS 270 -#define TK_CAST 271 -#define TK_POSITION 272 -#define TK_IN 273 -#define TK_FOR 274 -#define TK_NOW 275 -#define TK_TODAY 276 -#define TK_RAND 277 -#define TK_SUBSTR 278 -#define TK_SUBSTRING 279 -#define TK_BOTH 280 -#define TK_TRAILING 281 -#define TK_LEADING 282 -#define TK_TIMEZONE 283 -#define TK_CLIENT_VERSION 284 -#define TK_SERVER_VERSION 285 -#define TK_SERVER_STATUS 286 -#define TK_CURRENT_USER 287 -#define TK_PI 288 -#define TK_CASE 289 -#define TK_WHEN 290 -#define TK_THEN 291 -#define TK_ELSE 292 -#define TK_BETWEEN 293 -#define TK_IS 294 -#define TK_NK_LT 295 -#define TK_NK_GT 296 -#define TK_NK_LE 297 -#define TK_NK_GE 298 -#define TK_NK_NE 299 -#define TK_MATCH 300 -#define TK_NMATCH 301 -#define TK_CONTAINS 302 -#define TK_JOIN 303 -#define TK_INNER 304 -#define TK_LEFT 305 -#define TK_RIGHT 306 -#define TK_OUTER 307 -#define TK_SEMI 308 -#define TK_ANTI 309 -#define TK_ASOF 310 -#define TK_WINDOW 311 -#define TK_WINDOW_OFFSET 312 -#define TK_JLIMIT 313 -#define TK_SELECT 314 -#define TK_NK_HINT 315 -#define TK_DISTINCT 316 -#define TK_WHERE 317 -#define TK_PARTITION 318 -#define TK_BY 319 -#define TK_SESSION 320 -#define TK_STATE_WINDOW 321 -#define TK_EVENT_WINDOW 322 -#define TK_COUNT_WINDOW 323 -#define TK_ANOMALY_WINDOW 324 -#define TK_SLIDING 325 -#define TK_FILL 326 -#define TK_VALUE 327 -#define TK_VALUE_F 328 -#define TK_NONE 329 -#define TK_PREV 330 -#define TK_NULL_F 331 -#define TK_LINEAR 332 -#define TK_NEXT 333 -#define TK_HAVING 334 -#define TK_RANGE 335 -#define TK_EVERY 336 -#define TK_ORDER 337 -#define TK_SLIMIT 338 -#define TK_SOFFSET 339 -#define TK_LIMIT 340 -#define TK_OFFSET 341 -#define TK_ASC 342 -#define TK_NULLS 343 -#define TK_ABORT 344 -#define TK_AFTER 345 -#define TK_ATTACH 346 -#define TK_BEFORE 347 -#define TK_BEGIN 348 -#define TK_BITAND 349 -#define TK_BITNOT 350 -#define TK_BITOR 351 -#define TK_BLOCKS 352 -#define TK_CHANGE 353 -#define TK_COMMA 354 -#define TK_CONCAT 355 -#define TK_CONFLICT 356 -#define TK_COPY 357 -#define TK_DEFERRED 358 -#define TK_DELIMITERS 359 -#define TK_DETACH 360 -#define TK_DIVIDE 361 -#define TK_DOT 362 -#define TK_EACH 363 -#define TK_FAIL 364 -#define TK_GLOB 365 -#define TK_ID 366 -#define TK_IMMEDIATE 367 -#define TK_IMPORT 368 -#define TK_INITIALLY 369 -#define TK_INSTEAD 370 -#define TK_ISNULL 371 -#define TK_MODULES 372 -#define TK_NK_BITNOT 373 -#define TK_NK_SEMI 374 -#define TK_NOTNULL 375 -#define TK_OF 376 -#define TK_PLUS 377 -#define TK_PRIVILEGE 378 -#define TK_RAISE 379 -#define TK_RESTRICT 380 -#define TK_ROW 381 -#define TK_STAR 382 -#define TK_STATEMENT 383 -#define TK_STRICT 384 -#define TK_STRING 385 -#define TK_TIMES 386 -#define TK_VALUES 387 -#define TK_VARIABLE 388 -#define TK_WAL 389 - +#include "ttokenauto.h" #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 diff --git a/source/common/CMakeLists.txt b/source/common/CMakeLists.txt index 42a7c2c615..f10eb6a611 100644 --- a/source/common/CMakeLists.txt +++ b/source/common/CMakeLists.txt @@ -6,6 +6,8 @@ endif() add_library(common STATIC ${COMMON_SRC}) +add_dependencies(common lemon_sql) + if(DEFINED GRANT_CFG_INCLUDE_DIR) add_definitions(-DGRANTS_CFG) endif() diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index eac95e1a25..5b5d5c5d11 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -2096,6 +2096,7 @@ static int32_t generateSessionScanRange(SStreamScanInfo* pInfo, SSDataBlock* pSr if (pSrcBlock->info.rows == 0) { return TSDB_CODE_SUCCESS; } + SSHashObj* pScanRange = tSimpleHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT)); SExecTaskInfo* pTaskInfo = pInfo->pStreamScanOp->pTaskInfo; SColumnInfoData* pStartTsCol = taosArrayGet(pSrcBlock->pDataBlock, START_TS_COLUMN_INDEX); TSKEY* startData = (TSKEY*)pStartTsCol->pData; @@ -2157,6 +2158,14 @@ static int32_t generateSessionScanRange(SStreamScanInfo* pInfo, SSDataBlock* pSr qError("generate session scan range failed. rang start:%" PRIx64 ", end:%" PRIx64, startData[i], endData[i]); continue; } + + SSessionKey checkKey = {.groupId = groupId, .win.skey = startWin.win.skey, .win.ekey = endWin.win.ekey}; + if (tSimpleHashGet(pScanRange, &checkKey, sizeof(SSessionKey)) != NULL) { + continue; + } + code = tSimpleHashPut(pScanRange, &checkKey, sizeof(SSessionKey), NULL, 0); + QUERY_CHECK_CODE(code, lino, _end); + code = colDataSetVal(pDestStartCol, i, (const char*)&startWin.win.skey, false); QUERY_CHECK_CODE(code, lino, _end); @@ -2173,6 +2182,7 @@ static int32_t generateSessionScanRange(SStreamScanInfo* pInfo, SSDataBlock* pSr } _end: + tSimpleHashCleanup(pScanRange); if (code != TSDB_CODE_SUCCESS) { qError("%s failed at line %d since %s", __func__, lino, tstrerror(code)); } @@ -2431,6 +2441,7 @@ static int32_t generateIntervalScanRange(SStreamScanInfo* pInfo, SSDataBlock* pS if (pSrcBlock->info.rows == 0) { return TSDB_CODE_SUCCESS; } + SSHashObj* pScanRange = tSimpleHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT)); SExecTaskInfo* pTaskInfo = pInfo->pStreamScanOp->pTaskInfo; SColumnInfoData* pSrcStartTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, START_TS_COLUMN_INDEX); SColumnInfoData* pSrcEndTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, END_TS_COLUMN_INDEX); @@ -2491,6 +2502,13 @@ static int32_t generateIntervalScanRange(SStreamScanInfo* pInfo, SSDataBlock* pS code = colDataSetVal(pDeUidCol, pDestBlock->info.rows, (const char*)(&srcUid), false); QUERY_CHECK_CODE(code, lino, _end); + SSessionKey checkKey = {.groupId = groupId, .win = win}; + if (tSimpleHashGet(pScanRange, &checkKey, sizeof(SSessionKey)) != NULL) { + continue; + } + code = tSimpleHashPut(pScanRange, &checkKey, sizeof(SSessionKey), NULL, 0); + QUERY_CHECK_CODE(code, lino, _end); + code = colDataSetVal(pStartTsCol, pDestBlock->info.rows, (const char*)(&win.skey), false); QUERY_CHECK_CODE(code, lino, _end); @@ -2506,6 +2524,7 @@ static int32_t generateIntervalScanRange(SStreamScanInfo* pInfo, SSDataBlock* pS } _end: + tSimpleHashCleanup(pScanRange); if (code != TSDB_CODE_SUCCESS) { qError("%s failed at line %d since %s", __func__, lino, tstrerror(code)); } diff --git a/source/libs/parser/CMakeLists.txt b/source/libs/parser/CMakeLists.txt index f1b801c563..bd2dd95ee0 100644 --- a/source/libs/parser/CMakeLists.txt +++ b/source/libs/parser/CMakeLists.txt @@ -4,7 +4,27 @@ IF(TD_ENTERPRISE) LIST(APPEND PARSER_SRC ${TD_ENTERPRISE_DIR}/src/plugins/view/src/parserView.c) ENDIF() +add_custom_command( + OUTPUT ${TD_SOURCE_DIR}/source/libs/parser/src/sql.c ${TD_SOURCE_DIR}/include/common/ttokenauto.h + COMMAND echo "Running lemon process in ${TD_SOURCE_DIR}/source/libs/parser/inc" + COMMAND ${TD_CONTRIB_DIR}/lemon/lemon sql.y || true + COMMAND echo "copy sql.c from ${TD_SOURCE_DIR}/source/libs/parser/inc/sql.c to ${TD_SOURCE_DIR}/source/libs/parser/src/" + COMMAND mv ${TD_SOURCE_DIR}/source/libs/parser/inc/sql.c ${TD_SOURCE_DIR}/source/libs/parser/src/sql.c + COMMAND mv ${TD_SOURCE_DIR}/source/libs/parser/inc/sql.h ${TD_SOURCE_DIR}/include/common/ttokenauto.h + COMMAND echo "lemon process completed." + DEPENDS ${TD_SOURCE_DIR}/source/libs/parser/inc/sql.y + WORKING_DIRECTORY ${TD_SOURCE_DIR}/source/libs/parser/inc + COMMENT "Generating sql.c using lemon" +) + +add_custom_target(lemon_sql ALL + DEPENDS ${TD_SOURCE_DIR}/source/libs/parser/src/sql.c ${TD_SOURCE_DIR}/include/common/ttokenauto.h +) + +list(APPEND PARSER_SRC ${TD_SOURCE_DIR}/source/libs/parser/src/sql.c) + add_library(parser STATIC ${PARSER_SRC}) +add_dependencies(parser lemon_sql) target_include_directories( parser PUBLIC "${TD_SOURCE_DIR}/include/libs/parser" diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c deleted file mode 100644 index 06b5350ed8..0000000000 --- a/source/libs/parser/src/sql.c +++ /dev/null @@ -1,8545 +0,0 @@ -/* This file is automatically generated by Lemon from input grammar -** source file "sql.y". */ -/* -** 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: -*/ -/************ Begin %include sections from the grammar ************************/ -#include -#include -#include -#include -#include - -#define ALLOW_FORBID_FUNC - -#include "functionMgt.h" -#include "nodes.h" -#include "parToken.h" -#include "ttokendef.h" -#include "parAst.h" - -#define YYSTACKDEPTH 0 -/**************** End of %include directives **********************************/ -/* These constants specify the various numeric values for terminal symbols. -***************** Begin token definitions *************************************/ -#ifndef TK_OR -#define TK_OR 1 -#define TK_AND 2 -#define TK_UNION 3 -#define TK_ALL 4 -#define TK_MINUS 5 -#define TK_EXCEPT 6 -#define TK_INTERSECT 7 -#define TK_NK_BITAND 8 -#define TK_NK_BITOR 9 -#define TK_NK_LSHIFT 10 -#define TK_NK_RSHIFT 11 -#define TK_NK_PLUS 12 -#define TK_NK_MINUS 13 -#define TK_NK_STAR 14 -#define TK_NK_SLASH 15 -#define TK_NK_REM 16 -#define TK_NK_CONCAT 17 -#define TK_CREATE 18 -#define TK_ACCOUNT 19 -#define TK_NK_ID 20 -#define TK_PASS 21 -#define TK_NK_STRING 22 -#define TK_ALTER 23 -#define TK_PPS 24 -#define TK_TSERIES 25 -#define TK_STORAGE 26 -#define TK_STREAMS 27 -#define TK_QTIME 28 -#define TK_DBS 29 -#define TK_USERS 30 -#define TK_CONNS 31 -#define TK_STATE 32 -#define TK_NK_COMMA 33 -#define TK_HOST 34 -#define TK_IS_IMPORT 35 -#define TK_NK_INTEGER 36 -#define TK_CREATEDB 37 -#define TK_USER 38 -#define TK_ENABLE 39 -#define TK_SYSINFO 40 -#define TK_ADD 41 -#define TK_DROP 42 -#define TK_GRANT 43 -#define TK_ON 44 -#define TK_TO 45 -#define TK_REVOKE 46 -#define TK_FROM 47 -#define TK_SUBSCRIBE 48 -#define TK_READ 49 -#define TK_WRITE 50 -#define TK_NK_DOT 51 -#define TK_WITH 52 -#define TK_ENCRYPT_KEY 53 -#define TK_ANODE 54 -#define TK_UPDATE 55 -#define TK_ANODES 56 -#define TK_DNODE 57 -#define TK_PORT 58 -#define TK_DNODES 59 -#define TK_RESTORE 60 -#define TK_NK_IPTOKEN 61 -#define TK_FORCE 62 -#define TK_UNSAFE 63 -#define TK_CLUSTER 64 -#define TK_LOCAL 65 -#define TK_QNODE 66 -#define TK_BNODE 67 -#define TK_SNODE 68 -#define TK_MNODE 69 -#define TK_VNODE 70 -#define TK_DATABASE 71 -#define TK_USE 72 -#define TK_FLUSH 73 -#define TK_TRIM 74 -#define TK_S3MIGRATE 75 -#define TK_COMPACT 76 -#define TK_IF 77 -#define TK_NOT 78 -#define TK_EXISTS 79 -#define TK_BUFFER 80 -#define TK_CACHEMODEL 81 -#define TK_CACHESIZE 82 -#define TK_COMP 83 -#define TK_DURATION 84 -#define TK_NK_VARIABLE 85 -#define TK_MAXROWS 86 -#define TK_MINROWS 87 -#define TK_KEEP 88 -#define TK_PAGES 89 -#define TK_PAGESIZE 90 -#define TK_TSDB_PAGESIZE 91 -#define TK_PRECISION 92 -#define TK_REPLICA 93 -#define TK_VGROUPS 94 -#define TK_SINGLE_STABLE 95 -#define TK_RETENTIONS 96 -#define TK_SCHEMALESS 97 -#define TK_WAL_LEVEL 98 -#define TK_WAL_FSYNC_PERIOD 99 -#define TK_WAL_RETENTION_PERIOD 100 -#define TK_WAL_RETENTION_SIZE 101 -#define TK_WAL_ROLL_PERIOD 102 -#define TK_WAL_SEGMENT_SIZE 103 -#define TK_STT_TRIGGER 104 -#define TK_TABLE_PREFIX 105 -#define TK_TABLE_SUFFIX 106 -#define TK_S3_CHUNKPAGES 107 -#define TK_S3_KEEPLOCAL 108 -#define TK_S3_COMPACT 109 -#define TK_KEEP_TIME_OFFSET 110 -#define TK_ENCRYPT_ALGORITHM 111 -#define TK_NK_COLON 112 -#define TK_BWLIMIT 113 -#define TK_START 114 -#define TK_TIMESTAMP 115 -#define TK_END 116 -#define TK_TABLE 117 -#define TK_NK_LP 118 -#define TK_NK_RP 119 -#define TK_USING 120 -#define TK_FILE 121 -#define TK_STABLE 122 -#define TK_COLUMN 123 -#define TK_MODIFY 124 -#define TK_RENAME 125 -#define TK_TAG 126 -#define TK_SET 127 -#define TK_NK_EQ 128 -#define TK_TAGS 129 -#define TK_BOOL 130 -#define TK_TINYINT 131 -#define TK_SMALLINT 132 -#define TK_INT 133 -#define TK_INTEGER 134 -#define TK_BIGINT 135 -#define TK_FLOAT 136 -#define TK_DOUBLE 137 -#define TK_BINARY 138 -#define TK_NCHAR 139 -#define TK_UNSIGNED 140 -#define TK_JSON 141 -#define TK_VARCHAR 142 -#define TK_MEDIUMBLOB 143 -#define TK_BLOB 144 -#define TK_VARBINARY 145 -#define TK_GEOMETRY 146 -#define TK_DECIMAL 147 -#define TK_COMMENT 148 -#define TK_MAX_DELAY 149 -#define TK_WATERMARK 150 -#define TK_ROLLUP 151 -#define TK_TTL 152 -#define TK_SMA 153 -#define TK_DELETE_MARK 154 -#define TK_FIRST 155 -#define TK_LAST 156 -#define TK_SHOW 157 -#define TK_FULL 158 -#define TK_PRIVILEGES 159 -#define TK_DATABASES 160 -#define TK_TABLES 161 -#define TK_STABLES 162 -#define TK_MNODES 163 -#define TK_QNODES 164 -#define TK_ARBGROUPS 165 -#define TK_FUNCTIONS 166 -#define TK_INDEXES 167 -#define TK_ACCOUNTS 168 -#define TK_APPS 169 -#define TK_CONNECTIONS 170 -#define TK_LICENCES 171 -#define TK_GRANTS 172 -#define TK_LOGS 173 -#define TK_MACHINES 174 -#define TK_ENCRYPTIONS 175 -#define TK_QUERIES 176 -#define TK_SCORES 177 -#define TK_TOPICS 178 -#define TK_VARIABLES 179 -#define TK_BNODES 180 -#define TK_SNODES 181 -#define TK_TRANSACTIONS 182 -#define TK_DISTRIBUTED 183 -#define TK_CONSUMERS 184 -#define TK_SUBSCRIPTIONS 185 -#define TK_VNODES 186 -#define TK_ALIVE 187 -#define TK_VIEWS 188 -#define TK_VIEW 189 -#define TK_COMPACTS 190 -#define TK_NORMAL 191 -#define TK_CHILD 192 -#define TK_LIKE 193 -#define TK_TBNAME 194 -#define TK_QTAGS 195 -#define TK_AS 196 -#define TK_SYSTEM 197 -#define TK_TSMA 198 -#define TK_INTERVAL 199 -#define TK_RECURSIVE 200 -#define TK_TSMAS 201 -#define TK_FUNCTION 202 -#define TK_INDEX 203 -#define TK_COUNT 204 -#define TK_LAST_ROW 205 -#define TK_META 206 -#define TK_ONLY 207 -#define TK_TOPIC 208 -#define TK_CONSUMER 209 -#define TK_GROUP 210 -#define TK_DESC 211 -#define TK_DESCRIBE 212 -#define TK_RESET 213 -#define TK_QUERY 214 -#define TK_CACHE 215 -#define TK_EXPLAIN 216 -#define TK_ANALYZE 217 -#define TK_VERBOSE 218 -#define TK_NK_BOOL 219 -#define TK_RATIO 220 -#define TK_NK_FLOAT 221 -#define TK_OUTPUTTYPE 222 -#define TK_AGGREGATE 223 -#define TK_BUFSIZE 224 -#define TK_LANGUAGE 225 -#define TK_REPLACE 226 -#define TK_STREAM 227 -#define TK_INTO 228 -#define TK_PAUSE 229 -#define TK_RESUME 230 -#define TK_PRIMARY 231 -#define TK_KEY 232 -#define TK_TRIGGER 233 -#define TK_AT_ONCE 234 -#define TK_WINDOW_CLOSE 235 -#define TK_FORCE_WINDOW_CLOSE 236 -#define TK_IGNORE 237 -#define TK_EXPIRED 238 -#define TK_FILL_HISTORY 239 -#define TK_SUBTABLE 240 -#define TK_UNTREATED 241 -#define TK_KILL 242 -#define TK_CONNECTION 243 -#define TK_TRANSACTION 244 -#define TK_BALANCE 245 -#define TK_VGROUP 246 -#define TK_LEADER 247 -#define TK_MERGE 248 -#define TK_REDISTRIBUTE 249 -#define TK_SPLIT 250 -#define TK_DELETE 251 -#define TK_INSERT 252 -#define TK_NK_BIN 253 -#define TK_NK_HEX 254 -#define TK_NULL 255 -#define TK_NK_QUESTION 256 -#define TK_NK_ALIAS 257 -#define TK_NK_ARROW 258 -#define TK_ROWTS 259 -#define TK_QSTART 260 -#define TK_QEND 261 -#define TK_QDURATION 262 -#define TK_WSTART 263 -#define TK_WEND 264 -#define TK_WDURATION 265 -#define TK_IROWTS 266 -#define TK_ISFILLED 267 -#define TK_FLOW 268 -#define TK_FHIGH 269 -#define TK_FROWTS 270 -#define TK_CAST 271 -#define TK_POSITION 272 -#define TK_IN 273 -#define TK_FOR 274 -#define TK_NOW 275 -#define TK_TODAY 276 -#define TK_RAND 277 -#define TK_SUBSTR 278 -#define TK_SUBSTRING 279 -#define TK_BOTH 280 -#define TK_TRAILING 281 -#define TK_LEADING 282 -#define TK_TIMEZONE 283 -#define TK_CLIENT_VERSION 284 -#define TK_SERVER_VERSION 285 -#define TK_SERVER_STATUS 286 -#define TK_CURRENT_USER 287 -#define TK_PI 288 -#define TK_CASE 289 -#define TK_WHEN 290 -#define TK_THEN 291 -#define TK_ELSE 292 -#define TK_BETWEEN 293 -#define TK_IS 294 -#define TK_NK_LT 295 -#define TK_NK_GT 296 -#define TK_NK_LE 297 -#define TK_NK_GE 298 -#define TK_NK_NE 299 -#define TK_MATCH 300 -#define TK_NMATCH 301 -#define TK_CONTAINS 302 -#define TK_JOIN 303 -#define TK_INNER 304 -#define TK_LEFT 305 -#define TK_RIGHT 306 -#define TK_OUTER 307 -#define TK_SEMI 308 -#define TK_ANTI 309 -#define TK_ASOF 310 -#define TK_WINDOW 311 -#define TK_WINDOW_OFFSET 312 -#define TK_JLIMIT 313 -#define TK_SELECT 314 -#define TK_NK_HINT 315 -#define TK_DISTINCT 316 -#define TK_WHERE 317 -#define TK_PARTITION 318 -#define TK_BY 319 -#define TK_SESSION 320 -#define TK_STATE_WINDOW 321 -#define TK_EVENT_WINDOW 322 -#define TK_COUNT_WINDOW 323 -#define TK_ANOMALY_WINDOW 324 -#define TK_SLIDING 325 -#define TK_FILL 326 -#define TK_VALUE 327 -#define TK_VALUE_F 328 -#define TK_NONE 329 -#define TK_PREV 330 -#define TK_NULL_F 331 -#define TK_LINEAR 332 -#define TK_NEXT 333 -#define TK_HAVING 334 -#define TK_RANGE 335 -#define TK_EVERY 336 -#define TK_ORDER 337 -#define TK_SLIMIT 338 -#define TK_SOFFSET 339 -#define TK_LIMIT 340 -#define TK_OFFSET 341 -#define TK_ASC 342 -#define TK_NULLS 343 -#define TK_ABORT 344 -#define TK_AFTER 345 -#define TK_ATTACH 346 -#define TK_BEFORE 347 -#define TK_BEGIN 348 -#define TK_BITAND 349 -#define TK_BITNOT 350 -#define TK_BITOR 351 -#define TK_BLOCKS 352 -#define TK_CHANGE 353 -#define TK_COMMA 354 -#define TK_CONCAT 355 -#define TK_CONFLICT 356 -#define TK_COPY 357 -#define TK_DEFERRED 358 -#define TK_DELIMITERS 359 -#define TK_DETACH 360 -#define TK_DIVIDE 361 -#define TK_DOT 362 -#define TK_EACH 363 -#define TK_FAIL 364 -#define TK_GLOB 365 -#define TK_ID 366 -#define TK_IMMEDIATE 367 -#define TK_IMPORT 368 -#define TK_INITIALLY 369 -#define TK_INSTEAD 370 -#define TK_ISNULL 371 -#define TK_MODULES 372 -#define TK_NK_BITNOT 373 -#define TK_NK_SEMI 374 -#define TK_NOTNULL 375 -#define TK_OF 376 -#define TK_PLUS 377 -#define TK_PRIVILEGE 378 -#define TK_RAISE 379 -#define TK_RESTRICT 380 -#define TK_ROW 381 -#define TK_STAR 382 -#define TK_STATEMENT 383 -#define TK_STRICT 384 -#define TK_STRING 385 -#define TK_TIMES 386 -#define TK_VALUES 387 -#define TK_VARIABLE 388 -#define TK_WAL 389 -#endif -/**************** End 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. -** ParseTOKENTYPE is the data type used for minor type for terminal -** 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 -** which is ParseTOKENTYPE. The entry in the union -** for terminal symbols is called "yy0". -** YYSTACKDEPTH is the maximum depth of the parser's stack. If -** zero the stack is dynamically sized using realloc() -** 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 -** 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 *****************************************/ -#define YYCODETYPE unsigned short int -#define YYNOCODE 574 -#define YYACTIONTYPE unsigned short int -#define ParseTOKENTYPE SToken -typedef union { - int yyinit; - ParseTOKENTYPE yy0; - int8_t yy47; - EOrder yy274; - ENullOrder yy305; - STokenPair yy469; - SShowTablesOption yy513; - SAlterOption yy529; - SToken yy561; - EJoinSubType yy606; - SNodeList* yy628; - EJoinType yy652; - EOperatorType yy688; - EFillMode yy690; - int64_t yy781; - ETrimType yy840; - int32_t yy844; - SDataType yy896; - bool yy957; - SNode* yy980; - EShowKind yy1041; -} YYMINORTYPE; -#ifndef YYSTACKDEPTH -#define YYSTACKDEPTH 100 -#endif -#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 -#define YYFALLBACK 1 -#define YYNSTATE 1026 -#define YYNRULE 786 -#define YYNRULE_WITH_ACTION 786 -#define YYNTOKEN 390 -#define YY_MAX_SHIFT 1025 -#define YY_MIN_SHIFTREDUCE 1519 -#define YY_MAX_SHIFTREDUCE 2304 -#define YY_ERROR_ACTION 2305 -#define YY_ACCEPT_ACTION 2306 -#define YY_NO_ACTION 2307 -#define YY_MIN_REDUCE 2308 -#define YY_MAX_REDUCE 3093 -/************* 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 **********************************************/ -#define YY_ACTTAB_COUNT (4719) -static const YYACTIONTYPE yy_action[] = { - /* 0 */ 839, 683, 3066, 691, 684, 2356, 684, 2356, 3061, 205, - /* 10 */ 3061, 332, 60, 58, 887, 59, 57, 56, 55, 54, - /* 20 */ 506, 2309, 2021, 225, 466, 886, 838, 231, 2046, 3065, - /* 30 */ 220, 3062, 840, 3062, 3064, 126, 2019, 528, 2129, 2404, - /* 40 */ 2576, 2578, 151, 2848, 389, 150, 149, 148, 147, 146, - /* 50 */ 145, 144, 143, 142, 914, 851, 170, 2653, 854, 14, - /* 60 */ 13, 53, 52, 2514, 510, 59, 57, 56, 55, 54, - /* 70 */ 220, 2124, 151, 2050, 884, 150, 149, 148, 147, 146, - /* 80 */ 145, 144, 143, 142, 2823, 2027, 53, 52, 2866, 772, - /* 90 */ 59, 57, 56, 55, 54, 53, 52, 2653, 957, 59, - /* 100 */ 57, 56, 55, 54, 2813, 766, 896, 770, 768, 303, - /* 110 */ 302, 34, 703, 914, 2827, 1022, 638, 914, 61, 991, - /* 120 */ 990, 989, 988, 536, 75, 987, 986, 175, 981, 980, - /* 130 */ 979, 978, 977, 976, 975, 174, 969, 968, 967, 535, - /* 140 */ 534, 964, 963, 962, 211, 210, 961, 531, 960, 959, - /* 150 */ 958, 2847, 63, 2046, 2898, 2132, 2133, 2248, 134, 2849, - /* 160 */ 900, 2851, 2852, 895, 2829, 2832, 883, 2899, 919, 915, - /* 170 */ 2523, 2249, 2667, 213, 704, 2961, 2046, 2173, 919, 500, - /* 180 */ 2957, 207, 2969, 850, 256, 162, 849, 346, 347, 161, - /* 190 */ 914, 137, 345, 3061, 2082, 2092, 581, 2268, 731, 232, - /* 200 */ 526, 2525, 1866, 1867, 2131, 2134, 2106, 3008, 196, 637, - /* 210 */ 255, 838, 231, 127, 1751, 63, 3062, 840, 2526, 2022, - /* 220 */ 2247, 2020, 824, 635, 2196, 198, 882, 2320, 786, 1742, - /* 230 */ 946, 945, 944, 1746, 943, 1748, 1749, 942, 939, 64, - /* 240 */ 1757, 936, 1759, 1760, 933, 930, 927, 644, 642, 227, - /* 250 */ 441, 487, 2727, 245, 785, 2025, 2026, 2079, 2848, 2081, - /* 260 */ 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2093, 2094, - /* 270 */ 2095, 892, 885, 894, 75, 917, 916, 881, 2116, 2117, - /* 280 */ 2118, 2119, 2120, 2123, 2125, 2126, 2127, 2128, 2130, 2, - /* 290 */ 60, 58, 2221, 676, 2848, 445, 706, 2044, 506, 2308, - /* 300 */ 2021, 117, 674, 2866, 625, 670, 666, 469, 196, 897, - /* 310 */ 2051, 693, 2719, 307, 2019, 646, 2129, 526, 2525, 2813, - /* 320 */ 339, 896, 2050, 160, 159, 158, 157, 156, 155, 154, - /* 330 */ 153, 152, 574, 468, 604, 1921, 648, 573, 2046, 2866, - /* 340 */ 2196, 446, 606, 830, 825, 818, 814, 810, 339, 2124, - /* 350 */ 851, 170, 884, 584, 267, 2813, 19, 896, 686, 3066, - /* 360 */ 2364, 46, 688, 2027, 75, 220, 2847, 3061, 685, 2898, - /* 370 */ 2193, 2194, 2195, 436, 2849, 900, 2851, 2852, 895, 893, - /* 380 */ 2047, 883, 2899, 919, 874, 2926, 3065, 2680, 2495, 802, - /* 390 */ 3062, 3063, 2654, 1022, 467, 699, 15, 3061, 1947, 1948, - /* 400 */ 1949, 498, 2847, 915, 2523, 2898, 592, 2677, 901, 134, - /* 410 */ 2849, 900, 2851, 2852, 895, 3067, 231, 883, 2899, 919, - /* 420 */ 3062, 840, 172, 161, 181, 2932, 2961, 533, 532, 509, - /* 430 */ 500, 2957, 736, 2132, 2133, 339, 2047, 2660, 2639, 195, - /* 440 */ 634, 633, 631, 630, 629, 624, 623, 622, 621, 451, - /* 450 */ 2528, 2028, 611, 610, 609, 608, 607, 601, 600, 599, - /* 460 */ 702, 594, 593, 465, 572, 956, 571, 585, 1854, 1855, - /* 470 */ 339, 396, 2082, 2092, 1873, 853, 200, 2969, 2970, 9, - /* 480 */ 168, 2974, 2131, 2134, 224, 2981, 2193, 2194, 2195, 2981, - /* 490 */ 2981, 2981, 2981, 2981, 3066, 41, 518, 2022, 570, 2020, - /* 500 */ 2570, 53, 52, 1687, 882, 59, 57, 56, 55, 54, - /* 510 */ 185, 2049, 2083, 53, 52, 1790, 1791, 59, 57, 56, - /* 520 */ 55, 54, 53, 52, 45, 355, 59, 57, 56, 55, - /* 530 */ 54, 486, 2727, 2025, 2026, 2079, 2848, 2081, 2084, 2085, - /* 540 */ 2086, 2087, 2088, 2089, 2090, 2091, 2093, 2094, 2095, 892, - /* 550 */ 885, 854, 1689, 917, 916, 881, 2116, 2117, 289, 2051, - /* 560 */ 339, 2123, 2125, 2126, 2127, 2128, 2130, 2, 60, 58, - /* 570 */ 783, 1893, 1894, 2049, 729, 2080, 506, 206, 2021, 477, - /* 580 */ 475, 2866, 197, 458, 2733, 1751, 723, 719, 715, 711, - /* 590 */ 2454, 288, 2019, 2196, 2129, 2407, 67, 2813, 2823, 896, - /* 600 */ 1742, 946, 945, 944, 1746, 943, 1748, 1749, 891, 890, - /* 610 */ 2291, 1757, 889, 1759, 1760, 888, 930, 927, 53, 52, - /* 620 */ 1892, 1895, 59, 57, 56, 55, 54, 2124, 2827, 1595, - /* 630 */ 884, 1594, 2766, 2159, 19, 2976, 2031, 286, 851, 170, - /* 640 */ 974, 2027, 285, 2480, 2847, 166, 308, 2898, 829, 79, - /* 650 */ 2583, 134, 2849, 900, 2851, 2852, 895, 40, 496, 883, - /* 660 */ 2899, 919, 474, 472, 2973, 733, 213, 2757, 2961, 2581, - /* 670 */ 1596, 1022, 500, 2957, 15, 752, 751, 750, 2829, 2831, - /* 680 */ 501, 1990, 742, 167, 746, 2512, 735, 337, 745, 802, - /* 690 */ 734, 2583, 919, 744, 749, 480, 479, 3061, 2160, 743, - /* 700 */ 3009, 2225, 2140, 478, 739, 738, 737, 2046, 2046, 272, - /* 710 */ 858, 2132, 2133, 517, 516, 3067, 231, 956, 283, 2527, - /* 720 */ 3062, 840, 274, 281, 546, 2298, 2505, 473, 279, 697, - /* 730 */ 190, 2806, 2680, 12, 523, 409, 915, 2523, 2981, 2193, - /* 740 */ 2194, 2195, 2981, 2981, 2981, 2981, 2981, 271, 512, 337, - /* 750 */ 2082, 2092, 2678, 901, 407, 89, 530, 1699, 88, 558, - /* 760 */ 2131, 2134, 919, 75, 140, 2969, 2970, 470, 168, 2974, - /* 770 */ 2632, 1698, 447, 2583, 2807, 2022, 948, 2020, 2165, 2574, - /* 780 */ 782, 464, 882, 2027, 265, 661, 659, 656, 654, 2256, - /* 790 */ 915, 2523, 2581, 700, 512, 2767, 2306, 2622, 44, 502, - /* 800 */ 2154, 2155, 2156, 2157, 2158, 2162, 2163, 2164, 919, 947, - /* 810 */ 236, 2025, 2026, 2079, 588, 2081, 2084, 2085, 2086, 2087, - /* 820 */ 2088, 2089, 2090, 2091, 2093, 2094, 2095, 892, 885, 2497, - /* 830 */ 75, 917, 916, 881, 2116, 2117, 12, 512, 10, 2123, - /* 840 */ 2125, 2126, 2127, 2128, 2130, 2, 12, 60, 58, 251, - /* 850 */ 649, 919, 802, 740, 2680, 506, 2297, 2021, 701, 2673, - /* 860 */ 3061, 821, 820, 2254, 2255, 2257, 2258, 2259, 508, 76, - /* 870 */ 2494, 2019, 839, 2129, 2677, 901, 1680, 2848, 3067, 231, - /* 880 */ 3061, 2083, 2083, 3062, 840, 2079, 539, 171, 915, 2523, - /* 890 */ 2932, 538, 897, 2583, 2366, 107, 880, 562, 838, 231, - /* 900 */ 106, 269, 828, 3062, 840, 686, 2124, 2364, 68, 884, - /* 910 */ 590, 2649, 866, 19, 2198, 2199, 2200, 2201, 2202, 875, - /* 920 */ 2027, 2933, 2866, 101, 100, 577, 564, 560, 244, 53, - /* 930 */ 52, 2372, 2866, 59, 57, 56, 55, 54, 2813, 2498, - /* 940 */ 896, 569, 567, 802, 2080, 2080, 915, 2523, 596, 2649, - /* 950 */ 1022, 3061, 2218, 15, 444, 627, 2649, 556, 786, 339, - /* 960 */ 552, 548, 544, 541, 570, 247, 578, 105, 47, 3067, - /* 970 */ 231, 618, 176, 2021, 3062, 840, 617, 954, 187, 186, - /* 980 */ 951, 950, 949, 184, 616, 2847, 2976, 2019, 2898, 1009, - /* 990 */ 2132, 2133, 134, 2849, 900, 2851, 2852, 895, 113, 2976, - /* 1000 */ 883, 2899, 919, 249, 827, 915, 2523, 3081, 971, 2961, - /* 1010 */ 254, 915, 2523, 500, 2957, 2972, 784, 471, 954, 187, - /* 1020 */ 186, 951, 950, 949, 184, 579, 339, 2516, 2971, 2082, - /* 1030 */ 2092, 598, 915, 2523, 1025, 2510, 2027, 915, 2523, 2131, - /* 1040 */ 2134, 788, 2719, 53, 52, 915, 2523, 59, 57, 56, - /* 1050 */ 55, 54, 612, 393, 2022, 2508, 2020, 613, 521, 915, - /* 1060 */ 2523, 882, 725, 724, 43, 614, 1022, 2331, 1013, 1011, - /* 1070 */ 53, 52, 221, 2151, 59, 57, 56, 55, 54, 705, - /* 1080 */ 973, 1007, 1003, 999, 995, 2161, 388, 2050, 113, 1571, - /* 1090 */ 2025, 2026, 2079, 395, 2081, 2084, 2085, 2086, 2087, 2088, - /* 1100 */ 2089, 2090, 2091, 2093, 2094, 2095, 892, 885, 851, 170, - /* 1110 */ 917, 916, 881, 2116, 2117, 1569, 1570, 2517, 2123, 2125, - /* 1120 */ 2126, 2127, 2128, 2130, 2, 60, 58, 2135, 2813, 2848, - /* 1130 */ 915, 2523, 133, 506, 1564, 2021, 779, 361, 915, 2523, - /* 1140 */ 2577, 2578, 759, 306, 897, 2583, 3016, 305, 403, 2019, - /* 1150 */ 2518, 2129, 2560, 1571, 2267, 53, 52, 773, 309, 59, - /* 1160 */ 57, 56, 55, 54, 2582, 2166, 2848, 2583, 867, 833, - /* 1170 */ 2022, 801, 2020, 553, 2866, 511, 304, 97, 1566, 1569, - /* 1180 */ 1570, 897, 318, 3029, 2124, 42, 2581, 884, 1598, 1599, - /* 1190 */ 2813, 2583, 896, 802, 173, 762, 915, 2523, 2027, 527, - /* 1200 */ 238, 3061, 756, 754, 3065, 2513, 2025, 2026, 3, 301, - /* 1210 */ 2581, 2866, 877, 359, 2933, 873, 317, 2330, 342, 3067, - /* 1220 */ 231, 116, 66, 341, 3062, 840, 448, 2813, 1022, 896, - /* 1230 */ 485, 61, 774, 118, 201, 2969, 2970, 2847, 168, 2974, - /* 1240 */ 2898, 2207, 311, 1989, 134, 2849, 900, 2851, 2852, 895, - /* 1250 */ 915, 2523, 883, 2899, 919, 85, 1595, 2455, 1594, 3081, - /* 1260 */ 84, 2961, 787, 226, 2217, 500, 2957, 2329, 2132, 2133, - /* 1270 */ 857, 56, 55, 54, 2847, 520, 519, 2898, 2813, 727, - /* 1280 */ 726, 134, 2849, 900, 2851, 2852, 895, 748, 747, 883, - /* 1290 */ 2899, 919, 752, 751, 750, 163, 3081, 1596, 2961, 742, - /* 1300 */ 167, 746, 500, 2957, 529, 745, 396, 2082, 2092, 103, - /* 1310 */ 744, 749, 480, 479, 195, 73, 743, 2131, 2134, 802, - /* 1320 */ 478, 739, 738, 737, 2051, 2528, 799, 3061, 2813, 985, - /* 1330 */ 983, 2050, 2022, 2753, 2020, 2046, 53, 52, 2605, 882, - /* 1340 */ 59, 57, 56, 55, 54, 3067, 231, 2321, 53, 52, - /* 1350 */ 3062, 840, 59, 57, 56, 55, 54, 2328, 53, 52, - /* 1360 */ 2327, 314, 59, 57, 56, 55, 54, 2728, 2025, 2026, - /* 1370 */ 2079, 2326, 2081, 2084, 2085, 2086, 2087, 2088, 2089, 2090, - /* 1380 */ 2091, 2093, 2094, 2095, 892, 885, 843, 48, 917, 916, - /* 1390 */ 881, 2116, 2117, 2336, 1015, 922, 2123, 2125, 2126, 2127, - /* 1400 */ 2128, 2130, 2, 60, 58, 915, 2523, 2848, 915, 2523, - /* 1410 */ 2325, 506, 1703, 2021, 952, 855, 953, 2574, 2813, 2574, - /* 1420 */ 49, 2813, 897, 402, 816, 350, 1702, 2019, 871, 2129, - /* 1430 */ 915, 2523, 2813, 2594, 2848, 954, 187, 186, 951, 950, - /* 1440 */ 949, 184, 1573, 2585, 915, 2523, 915, 2523, 2045, 897, - /* 1450 */ 357, 3054, 2866, 915, 2523, 915, 2523, 735, 2324, 2101, - /* 1460 */ 2527, 734, 2124, 195, 908, 884, 909, 846, 2813, 2237, - /* 1470 */ 896, 2813, 802, 913, 2529, 385, 2027, 53, 52, 2866, - /* 1480 */ 3061, 59, 57, 56, 55, 54, 53, 52, 2030, 741, - /* 1490 */ 59, 57, 56, 55, 54, 2813, 620, 896, 3067, 231, - /* 1500 */ 2323, 2322, 809, 3062, 840, 651, 1022, 234, 2319, 61, - /* 1510 */ 2114, 619, 1678, 2318, 2317, 2847, 2316, 2315, 2898, 2813, - /* 1520 */ 2848, 2314, 134, 2849, 900, 2851, 2852, 895, 2313, 2312, - /* 1530 */ 883, 2899, 919, 2311, 678, 897, 177, 3081, 842, 2961, - /* 1540 */ 775, 3022, 2847, 500, 2957, 2898, 2132, 2133, 91, 134, - /* 1550 */ 2849, 900, 2851, 2852, 895, 177, 1682, 883, 2899, 919, - /* 1560 */ 294, 2813, 2813, 292, 3081, 2866, 2961, 205, 2051, 2813, - /* 1570 */ 500, 2957, 2080, 296, 2813, 2813, 295, 2813, 2813, 812, - /* 1580 */ 222, 2813, 2813, 896, 680, 2082, 2092, 2391, 2243, 2813, - /* 1590 */ 2813, 632, 2389, 2380, 2813, 2131, 2134, 2102, 62, 333, - /* 1600 */ 298, 647, 104, 297, 300, 1683, 923, 299, 2378, 753, - /* 1610 */ 2022, 62, 2020, 214, 755, 757, 185, 882, 344, 53, - /* 1620 */ 52, 2834, 1937, 59, 57, 56, 55, 54, 2847, 822, - /* 1630 */ 760, 2898, 325, 14, 13, 199, 2849, 900, 2851, 2852, - /* 1640 */ 895, 1945, 2029, 883, 2899, 919, 2025, 2026, 2079, 90, - /* 1650 */ 2081, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2093, - /* 1660 */ 2094, 2095, 892, 885, 62, 2241, 917, 916, 881, 2116, - /* 1670 */ 2117, 2300, 2301, 2033, 2123, 2125, 2126, 2127, 2128, 2130, - /* 1680 */ 2, 60, 58, 2848, 2253, 803, 3019, 165, 2836, 506, - /* 1690 */ 77, 2021, 844, 364, 363, 852, 62, 2252, 897, 323, - /* 1700 */ 2993, 2867, 856, 62, 348, 2019, 62, 2129, 2446, 2445, - /* 1710 */ 62, 90, 366, 365, 53, 52, 39, 3012, 59, 57, - /* 1720 */ 56, 55, 54, 776, 2357, 182, 163, 132, 2866, 129, - /* 1730 */ 2104, 185, 368, 367, 819, 863, 370, 369, 372, 371, - /* 1740 */ 2124, 374, 373, 884, 2813, 87, 896, 925, 376, 375, - /* 1750 */ 2105, 378, 377, 492, 2027, 53, 52, 380, 379, 59, - /* 1760 */ 57, 56, 55, 54, 53, 52, 183, 185, 59, 57, - /* 1770 */ 56, 55, 54, 53, 52, 847, 2167, 59, 57, 56, - /* 1780 */ 55, 54, 2115, 164, 1022, 382, 381, 61, 1659, 2108, - /* 1790 */ 182, 2847, 2096, 965, 2898, 2848, 1890, 1880, 134, 2849, - /* 1800 */ 900, 2851, 2852, 895, 384, 383, 883, 2899, 919, 966, - /* 1810 */ 897, 360, 912, 3081, 826, 2961, 1651, 1733, 1632, 500, - /* 1820 */ 2957, 488, 2658, 537, 2132, 2133, 860, 2032, 555, 2363, - /* 1830 */ 2571, 401, 1649, 1764, 795, 3013, 3023, 1660, 834, 835, - /* 1840 */ 2866, 330, 335, 338, 2659, 5, 2481, 540, 545, 462, - /* 1850 */ 2044, 554, 1772, 1779, 2054, 566, 2813, 565, 896, 239, - /* 1860 */ 568, 240, 242, 2082, 2092, 1914, 2107, 1633, 394, 1777, - /* 1870 */ 582, 2045, 589, 2131, 2134, 2103, 188, 591, 253, 595, - /* 1880 */ 597, 640, 602, 626, 2100, 636, 615, 2651, 2022, 628, - /* 1890 */ 2020, 639, 641, 652, 653, 882, 259, 650, 655, 657, - /* 1900 */ 262, 258, 138, 2847, 658, 660, 2898, 662, 2052, 681, - /* 1910 */ 202, 2849, 900, 2851, 2852, 895, 4, 682, 883, 2899, - /* 1920 */ 919, 689, 690, 270, 2025, 2026, 2079, 692, 2081, 2084, - /* 1930 */ 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2093, 2094, 2095, - /* 1940 */ 892, 885, 109, 2047, 917, 916, 881, 2116, 2117, 273, - /* 1950 */ 694, 2053, 2123, 2125, 2126, 2127, 2128, 2130, 2, 60, - /* 1960 */ 58, 695, 2055, 276, 2848, 696, 698, 506, 2056, 2021, - /* 1970 */ 278, 110, 841, 3082, 2674, 2057, 111, 2668, 112, 897, - /* 1980 */ 1731, 707, 284, 2019, 114, 2129, 730, 732, 287, 2511, - /* 1990 */ 763, 291, 764, 2743, 2507, 139, 293, 191, 439, 136, - /* 2000 */ 778, 2509, 2504, 115, 192, 193, 178, 780, 2048, 2866, - /* 2010 */ 790, 397, 789, 310, 2720, 315, 791, 313, 2124, 796, - /* 2020 */ 797, 884, 2740, 2739, 861, 2813, 3028, 896, 823, 794, - /* 2030 */ 806, 8, 2027, 832, 804, 837, 805, 3027, 2980, 807, - /* 2040 */ 836, 204, 326, 3000, 848, 533, 532, 324, 327, 320, - /* 2050 */ 331, 322, 328, 493, 169, 2035, 845, 2049, 2215, 2213, - /* 2060 */ 329, 2848, 1022, 3060, 217, 61, 340, 179, 859, 2028, - /* 2070 */ 864, 2129, 2847, 1, 398, 2898, 897, 3084, 233, 134, - /* 2080 */ 2849, 900, 2851, 2852, 895, 180, 399, 883, 2899, 919, - /* 2090 */ 334, 2977, 2688, 2687, 2936, 2686, 2961, 497, 865, 869, - /* 2100 */ 500, 2957, 2132, 2133, 2124, 353, 2866, 872, 74, 2942, - /* 2110 */ 904, 902, 906, 400, 907, 2805, 2524, 128, 2027, 358, - /* 2120 */ 2804, 125, 2813, 1543, 896, 1017, 2800, 1018, 2799, 2791, - /* 2130 */ 2790, 1019, 404, 2782, 65, 189, 2781, 2797, 2796, 2788, - /* 2140 */ 2787, 2082, 2092, 2776, 2775, 387, 1014, 390, 879, 2794, - /* 2150 */ 2793, 2131, 2134, 427, 391, 1021, 406, 440, 921, 476, - /* 2160 */ 782, 408, 454, 2785, 2765, 2784, 2022, 2773, 2020, 2847, - /* 2170 */ 438, 2772, 2898, 882, 2764, 2770, 134, 2849, 900, 2851, - /* 2180 */ 2852, 895, 524, 2763, 883, 2899, 919, 98, 428, 2769, - /* 2190 */ 2758, 2934, 2575, 2961, 542, 543, 1972, 500, 2957, 1973, - /* 2200 */ 547, 237, 2025, 2026, 2079, 2756, 2081, 2084, 2085, 2086, - /* 2210 */ 2087, 2088, 2089, 2090, 2091, 2093, 2094, 2095, 892, 885, - /* 2220 */ 549, 455, 917, 916, 881, 2116, 2117, 550, 551, 1971, - /* 2230 */ 2123, 2125, 2126, 2127, 2128, 2130, 2, 60, 58, 2755, - /* 2240 */ 2754, 463, 2752, 557, 2751, 506, 559, 2021, 2750, 561, - /* 2250 */ 2749, 563, 2036, 1959, 2031, 2724, 241, 2723, 243, 1917, - /* 2260 */ 99, 2019, 1916, 2129, 2701, 2700, 2699, 2848, 575, 576, - /* 2270 */ 2698, 2697, 2641, 580, 1853, 2638, 2637, 583, 2631, 586, - /* 2280 */ 2628, 587, 897, 246, 2627, 102, 2626, 2625, 2039, 2041, - /* 2290 */ 2630, 2629, 2624, 2623, 2621, 2620, 2124, 248, 2619, 884, - /* 2300 */ 250, 2618, 605, 603, 2616, 2615, 2614, 2613, 917, 916, - /* 2310 */ 2027, 2612, 2866, 2636, 2611, 2610, 2123, 2125, 2126, 2127, - /* 2320 */ 2128, 2130, 2609, 2634, 2617, 2608, 2607, 2606, 2813, 2604, - /* 2330 */ 896, 2603, 2602, 2601, 2600, 2599, 252, 2598, 2597, 2596, - /* 2340 */ 1022, 2595, 2593, 15, 108, 2592, 2666, 2635, 2633, 2591, - /* 2350 */ 2590, 2589, 1859, 2588, 2587, 257, 643, 645, 2586, 2584, - /* 2360 */ 452, 453, 1700, 2411, 2410, 1704, 2409, 260, 2408, 2406, - /* 2370 */ 261, 263, 1696, 264, 2403, 2847, 664, 2402, 2898, 2395, - /* 2380 */ 2132, 2133, 134, 2849, 900, 2851, 2852, 895, 663, 2382, - /* 2390 */ 883, 2899, 919, 667, 2370, 2369, 671, 876, 2352, 2961, - /* 2400 */ 665, 668, 1572, 500, 2957, 669, 673, 675, 679, 2351, - /* 2410 */ 2722, 677, 2848, 212, 266, 2718, 2708, 94, 2696, 2082, - /* 2420 */ 2092, 2833, 672, 268, 277, 2695, 223, 897, 95, 2131, - /* 2430 */ 2134, 275, 687, 280, 2672, 2665, 282, 2499, 2405, 2401, - /* 2440 */ 710, 708, 2399, 709, 2022, 714, 2020, 712, 713, 2397, - /* 2450 */ 716, 882, 718, 2394, 717, 720, 721, 2866, 2377, 2375, - /* 2460 */ 2376, 722, 1625, 2374, 2371, 728, 2348, 2501, 1784, 1783, - /* 2470 */ 2500, 758, 1686, 2813, 1668, 896, 1685, 1684, 982, 1681, - /* 2480 */ 2025, 2026, 2079, 481, 2081, 2084, 2085, 2086, 2087, 2088, - /* 2490 */ 2089, 2090, 2091, 2093, 2094, 2095, 892, 885, 1679, 2392, - /* 2500 */ 917, 916, 881, 2116, 2117, 1677, 984, 1676, 2123, 2125, - /* 2510 */ 2126, 2127, 2128, 2130, 2, 450, 449, 1675, 2848, 1674, - /* 2520 */ 2847, 86, 1673, 2898, 2390, 513, 290, 135, 2849, 900, - /* 2530 */ 2851, 2852, 895, 897, 1670, 883, 2899, 919, 1669, 522, - /* 2540 */ 1667, 2129, 482, 2381, 2961, 2848, 2379, 483, 2960, 2957, - /* 2550 */ 484, 761, 2347, 2346, 2345, 765, 2344, 767, 2343, 769, - /* 2560 */ 897, 2342, 771, 2866, 141, 1953, 1955, 1952, 2721, 312, - /* 2570 */ 1957, 2717, 33, 80, 2124, 1923, 2707, 1925, 2694, 2813, - /* 2580 */ 2693, 896, 792, 22, 3066, 2848, 69, 17, 808, 228, - /* 2590 */ 2866, 2270, 35, 319, 6, 2244, 36, 7, 2242, 70, - /* 2600 */ 897, 811, 793, 489, 817, 813, 2813, 815, 896, 316, - /* 2610 */ 23, 321, 2848, 2251, 203, 24, 1902, 1901, 215, 37, - /* 2620 */ 216, 2834, 38, 96, 1942, 2236, 2847, 897, 1927, 2898, - /* 2630 */ 2866, 25, 798, 135, 2849, 900, 2851, 2852, 895, 800, - /* 2640 */ 229, 883, 2899, 919, 781, 194, 2813, 2208, 896, 2210, - /* 2650 */ 2961, 2206, 230, 898, 878, 2957, 2898, 2866, 78, 26, - /* 2660 */ 135, 2849, 900, 2851, 2852, 895, 2290, 2291, 883, 2899, - /* 2670 */ 919, 2285, 2284, 2813, 494, 896, 2289, 2961, 2288, 495, - /* 2680 */ 336, 457, 2957, 2190, 72, 208, 2692, 2671, 2189, 120, - /* 2690 */ 119, 2670, 343, 2847, 2246, 2664, 2898, 218, 121, 27, - /* 2700 */ 413, 2849, 900, 2851, 2852, 895, 349, 32, 883, 2899, - /* 2710 */ 919, 862, 82, 351, 868, 352, 870, 122, 2142, 11, - /* 2720 */ 2847, 2141, 2012, 2898, 1988, 354, 13, 135, 2849, 900, - /* 2730 */ 2851, 2852, 895, 71, 2037, 883, 2899, 919, 21, 2152, - /* 2740 */ 28, 18, 29, 20, 2961, 50, 2663, 209, 932, 2958, - /* 2750 */ 2099, 2098, 2097, 219, 2072, 935, 515, 514, 2013, 938, - /* 2760 */ 123, 2496, 941, 910, 51, 16, 30, 899, 31, 2848, - /* 2770 */ 362, 2064, 903, 905, 83, 356, 124, 92, 917, 916, - /* 2780 */ 129, 2911, 911, 2910, 897, 918, 2123, 2125, 2126, 2127, - /* 2790 */ 2128, 2130, 2304, 2111, 81, 2303, 1765, 2848, 924, 920, - /* 2800 */ 525, 926, 928, 1762, 1761, 931, 929, 934, 1758, 1752, - /* 2810 */ 937, 1750, 897, 940, 2866, 1756, 130, 386, 1755, 1754, - /* 2820 */ 1753, 131, 1778, 93, 1774, 1664, 1623, 955, 1663, 1662, - /* 2830 */ 2813, 1661, 896, 1658, 1655, 1654, 1653, 1652, 1694, 970, - /* 2840 */ 1650, 1648, 2866, 1647, 1646, 1693, 972, 235, 1644, 1643, - /* 2850 */ 1641, 2400, 1642, 1640, 503, 1639, 1638, 1690, 2813, 1688, - /* 2860 */ 896, 1635, 1634, 1631, 1629, 1630, 1628, 992, 993, 2398, - /* 2870 */ 996, 2396, 1000, 2393, 2373, 997, 994, 2847, 1001, 998, - /* 2880 */ 2898, 2848, 1002, 1004, 437, 2849, 900, 2851, 2852, 895, - /* 2890 */ 1005, 1008, 883, 2899, 919, 2368, 897, 1006, 1010, 2367, - /* 2900 */ 1012, 1561, 2341, 1544, 1549, 2847, 1551, 392, 2898, 2848, - /* 2910 */ 1016, 1020, 199, 2849, 900, 2851, 2852, 895, 2023, 405, - /* 2920 */ 883, 2899, 919, 1024, 897, 1023, 2866, 2307, 2307, 2307, - /* 2930 */ 2848, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 2940 */ 2307, 2307, 2813, 2307, 896, 897, 2307, 2307, 2307, 2307, - /* 2950 */ 2307, 2307, 2307, 2307, 2866, 2307, 2307, 2307, 2307, 2307, - /* 2960 */ 2307, 2307, 2307, 3020, 2307, 2307, 490, 2307, 2307, 2307, - /* 2970 */ 2813, 2307, 896, 2307, 2307, 2866, 2307, 2307, 2307, 2307, - /* 2980 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2847, - /* 2990 */ 2307, 2813, 2898, 896, 491, 2307, 437, 2849, 900, 2851, - /* 3000 */ 2852, 895, 2307, 2307, 883, 2899, 919, 2307, 2307, 2307, - /* 3010 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2847, 2307, 2307, - /* 3020 */ 2898, 2848, 2307, 2307, 437, 2849, 900, 2851, 2852, 895, - /* 3030 */ 2307, 2307, 883, 2899, 919, 2307, 897, 2307, 2847, 2307, - /* 3040 */ 2307, 2898, 2848, 2307, 2307, 430, 2849, 900, 2851, 2852, - /* 3050 */ 895, 2307, 2307, 883, 2899, 919, 2307, 894, 2307, 2307, - /* 3060 */ 2307, 2307, 2848, 2307, 2307, 2307, 2866, 2307, 2307, 2307, - /* 3070 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 897, 2307, 2307, - /* 3080 */ 2307, 2307, 2813, 2307, 896, 2307, 2307, 2866, 2307, 2307, - /* 3090 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 831, - /* 3100 */ 2307, 2307, 2307, 2813, 2307, 896, 2307, 2866, 2307, 2307, - /* 3110 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3120 */ 2307, 2307, 2307, 2813, 2307, 896, 2307, 2307, 2307, 2847, - /* 3130 */ 2307, 2307, 2898, 2307, 2307, 2307, 202, 2849, 900, 2851, - /* 3140 */ 2852, 895, 2307, 2307, 883, 2899, 919, 504, 2307, 2307, - /* 3150 */ 2847, 2307, 2307, 2898, 2307, 2307, 2307, 436, 2849, 900, - /* 3160 */ 2851, 2852, 895, 2307, 2307, 883, 2899, 919, 2307, 2927, - /* 3170 */ 2847, 2307, 2307, 2898, 2307, 2307, 2307, 437, 2849, 900, - /* 3180 */ 2851, 2852, 895, 2848, 2307, 883, 2899, 919, 2307, 2307, - /* 3190 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 897, 3083, - /* 3200 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2848, 2307, - /* 3210 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3220 */ 2307, 2307, 2307, 897, 2307, 2307, 2307, 2307, 2866, 2307, - /* 3230 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3240 */ 2307, 2307, 2307, 2307, 2813, 2307, 896, 2307, 2307, 2307, - /* 3250 */ 2307, 2307, 2848, 2866, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3260 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 897, 499, 2813, - /* 3270 */ 2307, 896, 2307, 2307, 2307, 2848, 2307, 2307, 2307, 2307, - /* 3280 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3290 */ 897, 2847, 2307, 505, 2898, 2307, 2307, 2866, 422, 2849, - /* 3300 */ 900, 2851, 2852, 895, 2307, 2307, 883, 2899, 919, 2307, - /* 3310 */ 2307, 2307, 2307, 2813, 2307, 896, 2847, 2307, 2307, 2898, - /* 3320 */ 2866, 2307, 2307, 437, 2849, 900, 2851, 2852, 895, 2307, - /* 3330 */ 2307, 883, 2899, 919, 2307, 2307, 2813, 507, 896, 2307, - /* 3340 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3350 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3360 */ 2847, 2307, 2307, 2898, 2848, 2307, 2307, 437, 2849, 900, - /* 3370 */ 2851, 2852, 895, 2307, 2307, 883, 2899, 919, 2307, 897, - /* 3380 */ 2307, 2307, 2307, 2847, 2307, 2307, 2898, 2848, 2307, 2307, - /* 3390 */ 418, 2849, 900, 2851, 2852, 895, 2307, 2307, 883, 2899, - /* 3400 */ 919, 2307, 897, 2307, 2307, 2307, 2307, 2307, 2307, 2866, - /* 3410 */ 2307, 2307, 2307, 2307, 2307, 2848, 2307, 2307, 2307, 2307, - /* 3420 */ 2307, 2307, 2307, 2307, 2307, 2813, 2307, 896, 2307, 2307, - /* 3430 */ 897, 2307, 2866, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3440 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2813, 2307, - /* 3450 */ 896, 2307, 2307, 2307, 2307, 2307, 2848, 2307, 2307, 2307, - /* 3460 */ 2866, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3470 */ 2307, 897, 777, 2307, 2307, 2898, 2813, 2307, 896, 432, - /* 3480 */ 2849, 900, 2851, 2852, 895, 2307, 2307, 883, 2899, 919, - /* 3490 */ 2307, 2307, 2307, 2307, 2307, 2847, 2307, 2307, 2898, 2848, - /* 3500 */ 2307, 2866, 414, 2849, 900, 2851, 2852, 895, 2307, 2307, - /* 3510 */ 883, 2899, 919, 2307, 897, 2307, 2307, 2813, 2307, 896, - /* 3520 */ 2307, 2307, 2307, 2847, 2307, 2307, 2898, 2307, 2307, 2307, - /* 3530 */ 410, 2849, 900, 2851, 2852, 895, 2307, 2307, 883, 2899, - /* 3540 */ 919, 2848, 2307, 2307, 2866, 2307, 2307, 2307, 2307, 2307, - /* 3550 */ 2307, 2307, 2307, 2307, 2307, 2307, 897, 2307, 2307, 2307, - /* 3560 */ 2813, 2307, 896, 2307, 2847, 2307, 2307, 2898, 2307, 2307, - /* 3570 */ 2307, 411, 2849, 900, 2851, 2852, 895, 2307, 2307, 883, - /* 3580 */ 2899, 919, 2307, 2307, 2307, 2307, 2866, 2307, 2307, 2307, - /* 3590 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3600 */ 2307, 2307, 2813, 2307, 896, 2307, 2307, 2847, 2307, 2307, - /* 3610 */ 2898, 2307, 2307, 2307, 415, 2849, 900, 2851, 2852, 895, - /* 3620 */ 2307, 2307, 883, 2899, 919, 2307, 2307, 2307, 2307, 2307, - /* 3630 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2848, 2307, - /* 3640 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2847, - /* 3650 */ 2307, 2307, 2898, 897, 2307, 2307, 429, 2849, 900, 2851, - /* 3660 */ 2852, 895, 2848, 2307, 883, 2899, 919, 2307, 2307, 2307, - /* 3670 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 897, 2307, 2307, - /* 3680 */ 2307, 2307, 2307, 2866, 2307, 2307, 2307, 2848, 2307, 2307, - /* 3690 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2813, - /* 3700 */ 2307, 896, 897, 2307, 2307, 2307, 2307, 2866, 2307, 2307, - /* 3710 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3720 */ 2307, 2307, 2307, 2813, 2307, 896, 2307, 2848, 2307, 2307, - /* 3730 */ 2307, 2307, 2866, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3740 */ 2307, 2307, 897, 2307, 2307, 2307, 2847, 2307, 2813, 2898, - /* 3750 */ 896, 2307, 2307, 416, 2849, 900, 2851, 2852, 895, 2307, - /* 3760 */ 2307, 883, 2899, 919, 2307, 2307, 2307, 2307, 2307, 2848, - /* 3770 */ 2847, 2307, 2866, 2898, 2307, 2307, 2307, 417, 2849, 900, - /* 3780 */ 2851, 2852, 895, 2307, 897, 883, 2899, 919, 2813, 2307, - /* 3790 */ 896, 2307, 2307, 2307, 2848, 2847, 2307, 2307, 2898, 2307, - /* 3800 */ 2307, 2307, 433, 2849, 900, 2851, 2852, 895, 2307, 897, - /* 3810 */ 883, 2899, 919, 2307, 2866, 2307, 2307, 2307, 2307, 2307, - /* 3820 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3830 */ 2813, 2307, 896, 2307, 2307, 2847, 2307, 2307, 2898, 2866, - /* 3840 */ 2307, 2307, 419, 2849, 900, 2851, 2852, 895, 2307, 2307, - /* 3850 */ 883, 2899, 919, 2307, 2307, 2813, 2307, 896, 2307, 2307, - /* 3860 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3870 */ 2307, 2307, 2307, 2307, 2307, 2848, 2307, 2847, 2307, 2307, - /* 3880 */ 2898, 2307, 2307, 2307, 434, 2849, 900, 2851, 2852, 895, - /* 3890 */ 897, 2307, 883, 2899, 919, 2307, 2307, 2307, 2307, 2307, - /* 3900 */ 2848, 2307, 2847, 2307, 2307, 2898, 2307, 2307, 2307, 420, - /* 3910 */ 2849, 900, 2851, 2852, 895, 897, 2307, 883, 2899, 919, - /* 3920 */ 2866, 2307, 2307, 2307, 2848, 2307, 2307, 2307, 2307, 2307, - /* 3930 */ 2307, 2307, 2307, 2307, 2307, 2307, 2813, 2307, 896, 897, - /* 3940 */ 2307, 2307, 2307, 2307, 2307, 2866, 2307, 2307, 2307, 2307, - /* 3950 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3960 */ 2307, 2813, 2307, 896, 2307, 2848, 2307, 2307, 2307, 2866, - /* 3970 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 3980 */ 897, 2307, 2307, 2847, 2307, 2813, 2898, 896, 2307, 2307, - /* 3990 */ 435, 2849, 900, 2851, 2852, 895, 2307, 2307, 883, 2899, - /* 4000 */ 919, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2847, 2307, - /* 4010 */ 2866, 2898, 2307, 2307, 2307, 421, 2849, 900, 2851, 2852, - /* 4020 */ 895, 2307, 2307, 883, 2899, 919, 2813, 2307, 896, 2307, - /* 4030 */ 2307, 2307, 2847, 2307, 2307, 2898, 2307, 2307, 2307, 412, - /* 4040 */ 2849, 900, 2851, 2852, 895, 2307, 2848, 883, 2899, 919, - /* 4050 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4060 */ 2307, 897, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4070 */ 2307, 2848, 2307, 2847, 2307, 2307, 2898, 2307, 2307, 2307, - /* 4080 */ 423, 2849, 900, 2851, 2852, 895, 897, 2307, 883, 2899, - /* 4090 */ 919, 2866, 2307, 2307, 2307, 2848, 2307, 2307, 2307, 2307, - /* 4100 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2813, 2307, 896, - /* 4110 */ 897, 2307, 2307, 2307, 2307, 2307, 2866, 2307, 2307, 2307, - /* 4120 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4130 */ 2307, 2307, 2813, 2307, 896, 2307, 2848, 2307, 2307, 2307, - /* 4140 */ 2866, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4150 */ 2307, 897, 2307, 2307, 2847, 2307, 2813, 2898, 896, 2307, - /* 4160 */ 2307, 424, 2849, 900, 2851, 2852, 895, 2307, 2307, 883, - /* 4170 */ 2899, 919, 2307, 2307, 2307, 2307, 2307, 2307, 2848, 2847, - /* 4180 */ 2307, 2866, 2898, 2307, 2307, 2307, 425, 2849, 900, 2851, - /* 4190 */ 2852, 895, 2307, 897, 883, 2899, 919, 2813, 2307, 896, - /* 4200 */ 2307, 2848, 2307, 2847, 2307, 2307, 2898, 2307, 2307, 2307, - /* 4210 */ 426, 2849, 900, 2851, 2852, 895, 897, 2307, 883, 2899, - /* 4220 */ 919, 2307, 2307, 2866, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4230 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2813, - /* 4240 */ 2307, 896, 2307, 2307, 2847, 2307, 2866, 2898, 2307, 2307, - /* 4250 */ 2307, 442, 2849, 900, 2851, 2852, 895, 2307, 2307, 883, - /* 4260 */ 2899, 919, 2813, 2307, 896, 2307, 2307, 2307, 2307, 2848, - /* 4270 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4280 */ 2307, 2307, 2307, 2307, 897, 2307, 2847, 2307, 2307, 2898, - /* 4290 */ 2307, 2307, 2307, 443, 2849, 900, 2851, 2852, 895, 2307, - /* 4300 */ 2307, 883, 2899, 919, 2307, 2307, 2307, 2848, 2307, 2847, - /* 4310 */ 2307, 2307, 2898, 2307, 2866, 2307, 2860, 2849, 900, 2851, - /* 4320 */ 2852, 895, 897, 2307, 883, 2899, 919, 2307, 2307, 2307, - /* 4330 */ 2813, 2307, 896, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4340 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4350 */ 2307, 2307, 2866, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4360 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2813, 2307, - /* 4370 */ 896, 2307, 2307, 2307, 2307, 2307, 2307, 2847, 2307, 2307, - /* 4380 */ 2898, 2307, 2307, 2307, 2859, 2849, 900, 2851, 2852, 895, - /* 4390 */ 2307, 2307, 883, 2899, 919, 2307, 2307, 2307, 2307, 2307, - /* 4400 */ 2307, 2307, 2848, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4410 */ 2307, 2307, 2307, 2307, 2307, 2847, 2307, 897, 2898, 2307, - /* 4420 */ 2307, 2307, 2858, 2849, 900, 2851, 2852, 895, 2307, 2848, - /* 4430 */ 883, 2899, 919, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4440 */ 2307, 2307, 2307, 2307, 897, 2307, 2307, 2866, 2307, 2307, - /* 4450 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4460 */ 2307, 2307, 2307, 2813, 2307, 896, 2307, 2848, 2307, 2307, - /* 4470 */ 2307, 2307, 2307, 2307, 2866, 2307, 2307, 2307, 2307, 2307, - /* 4480 */ 2307, 2307, 897, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4490 */ 2813, 2307, 896, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4500 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4510 */ 2847, 2307, 2866, 2898, 2307, 2307, 2307, 459, 2849, 900, - /* 4520 */ 2851, 2852, 895, 2307, 2307, 883, 2899, 919, 2813, 2307, - /* 4530 */ 896, 2307, 2307, 2307, 2307, 2307, 2307, 2847, 2307, 2307, - /* 4540 */ 2898, 2307, 2307, 2307, 460, 2849, 900, 2851, 2852, 895, - /* 4550 */ 2848, 2307, 883, 2899, 919, 2307, 2307, 2307, 2307, 2307, - /* 4560 */ 2307, 2307, 2307, 2307, 2307, 897, 2307, 2307, 2307, 2307, - /* 4570 */ 2307, 2307, 2307, 2848, 2307, 2847, 2307, 2307, 2898, 2307, - /* 4580 */ 2307, 2307, 456, 2849, 900, 2851, 2852, 895, 897, 2307, - /* 4590 */ 883, 2899, 919, 2848, 2307, 2866, 2307, 2307, 2307, 2307, - /* 4600 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 897, 2307, - /* 4610 */ 2307, 2813, 2307, 896, 2307, 2307, 2307, 2307, 2866, 2307, - /* 4620 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4630 */ 2307, 2307, 2307, 2307, 2813, 2307, 896, 2307, 2866, 2307, - /* 4640 */ 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, 2307, - /* 4650 */ 2307, 2307, 2307, 2307, 2813, 2307, 896, 2307, 2847, 2307, - /* 4660 */ 2307, 2898, 2307, 2307, 2307, 461, 2849, 900, 2851, 2852, - /* 4670 */ 895, 2307, 2307, 883, 2899, 919, 2307, 2307, 2307, 2307, - /* 4680 */ 2307, 898, 2307, 2307, 2898, 2307, 2307, 2307, 432, 2849, - /* 4690 */ 900, 2851, 2852, 895, 2307, 2307, 883, 2899, 919, 2307, - /* 4700 */ 2307, 2847, 2307, 2307, 2898, 2307, 2307, 2307, 431, 2849, - /* 4710 */ 900, 2851, 2852, 895, 2307, 2307, 883, 2899, 919, -}; -static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 537, 402, 537, 402, 405, 406, 405, 406, 545, 539, - /* 10 */ 545, 541, 12, 13, 439, 12, 13, 14, 15, 16, - /* 20 */ 20, 0, 22, 486, 432, 450, 563, 564, 20, 564, - /* 30 */ 438, 568, 569, 568, 569, 414, 36, 452, 38, 0, - /* 40 */ 455, 456, 21, 393, 34, 24, 25, 26, 27, 28, - /* 50 */ 29, 30, 31, 32, 20, 407, 408, 465, 408, 1, - /* 60 */ 2, 8, 9, 442, 432, 12, 13, 14, 15, 16, - /* 70 */ 438, 71, 21, 20, 74, 24, 25, 26, 27, 28, - /* 80 */ 29, 30, 31, 32, 424, 85, 8, 9, 438, 21, - /* 90 */ 12, 13, 14, 15, 16, 8, 9, 465, 59, 12, - /* 100 */ 13, 14, 15, 16, 454, 37, 456, 39, 40, 41, - /* 110 */ 42, 33, 407, 20, 454, 115, 94, 20, 118, 80, - /* 120 */ 81, 82, 83, 84, 118, 86, 87, 88, 89, 90, - /* 130 */ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - /* 140 */ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - /* 150 */ 111, 501, 118, 20, 504, 155, 156, 22, 508, 509, - /* 160 */ 510, 511, 512, 513, 504, 505, 516, 517, 518, 407, - /* 170 */ 408, 36, 467, 523, 469, 525, 20, 119, 518, 529, - /* 180 */ 530, 533, 534, 535, 162, 537, 538, 149, 150, 427, - /* 190 */ 20, 438, 154, 545, 194, 195, 407, 119, 436, 549, - /* 200 */ 447, 448, 194, 195, 204, 205, 119, 557, 438, 187, - /* 210 */ 188, 563, 564, 120, 115, 118, 568, 569, 448, 219, - /* 220 */ 85, 221, 199, 201, 158, 392, 226, 394, 407, 130, - /* 230 */ 131, 132, 133, 134, 135, 136, 137, 138, 139, 118, - /* 240 */ 141, 142, 143, 144, 145, 146, 147, 458, 459, 196, - /* 250 */ 461, 498, 499, 464, 20, 255, 256, 257, 393, 259, - /* 260 */ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - /* 270 */ 270, 271, 272, 408, 118, 275, 276, 277, 278, 279, - /* 280 */ 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - /* 290 */ 12, 13, 14, 57, 393, 18, 77, 20, 20, 0, - /* 300 */ 22, 189, 66, 438, 27, 69, 70, 30, 438, 408, - /* 310 */ 257, 490, 491, 149, 36, 38, 38, 447, 448, 454, - /* 320 */ 314, 456, 20, 24, 25, 26, 27, 28, 29, 30, - /* 330 */ 31, 32, 480, 56, 57, 223, 59, 485, 20, 438, - /* 340 */ 158, 64, 65, 320, 321, 322, 323, 324, 314, 71, - /* 350 */ 407, 408, 74, 76, 403, 454, 78, 456, 407, 537, - /* 360 */ 409, 274, 14, 85, 118, 438, 501, 545, 20, 504, - /* 370 */ 304, 305, 306, 508, 509, 510, 511, 512, 513, 514, - /* 380 */ 20, 516, 517, 518, 519, 520, 564, 456, 0, 537, - /* 390 */ 568, 569, 465, 115, 117, 20, 118, 545, 234, 235, - /* 400 */ 236, 470, 501, 407, 408, 504, 129, 476, 477, 508, - /* 410 */ 509, 510, 511, 512, 513, 563, 564, 516, 517, 518, - /* 420 */ 568, 569, 521, 427, 523, 524, 525, 12, 13, 428, - /* 430 */ 529, 530, 436, 155, 156, 314, 20, 160, 161, 438, - /* 440 */ 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - /* 450 */ 449, 36, 175, 176, 177, 178, 179, 180, 181, 182, - /* 460 */ 20, 184, 185, 186, 218, 77, 220, 190, 191, 192, - /* 470 */ 314, 438, 194, 195, 197, 532, 533, 534, 535, 44, - /* 480 */ 537, 538, 204, 205, 437, 303, 304, 305, 306, 307, - /* 490 */ 308, 309, 310, 311, 3, 2, 36, 219, 252, 221, - /* 500 */ 453, 8, 9, 36, 226, 12, 13, 14, 15, 16, - /* 510 */ 33, 20, 194, 8, 9, 155, 156, 12, 13, 14, - /* 520 */ 15, 16, 8, 9, 526, 527, 12, 13, 14, 15, - /* 530 */ 16, 498, 499, 255, 256, 257, 393, 259, 260, 261, - /* 540 */ 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - /* 550 */ 272, 408, 85, 275, 276, 277, 278, 279, 38, 257, - /* 560 */ 314, 283, 284, 285, 286, 287, 288, 289, 12, 13, - /* 570 */ 129, 155, 156, 20, 54, 257, 20, 57, 22, 41, - /* 580 */ 42, 438, 417, 78, 433, 115, 66, 67, 68, 69, - /* 590 */ 425, 71, 36, 158, 38, 0, 119, 454, 424, 456, - /* 600 */ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - /* 610 */ 119, 141, 142, 143, 144, 145, 146, 147, 8, 9, - /* 620 */ 204, 205, 12, 13, 14, 15, 16, 71, 454, 20, - /* 630 */ 74, 22, 480, 128, 78, 507, 221, 117, 407, 408, - /* 640 */ 423, 85, 122, 426, 501, 36, 495, 504, 20, 4, - /* 650 */ 438, 508, 509, 510, 511, 512, 513, 47, 446, 516, - /* 660 */ 517, 518, 124, 125, 536, 127, 523, 0, 525, 457, - /* 670 */ 61, 115, 529, 530, 118, 80, 81, 82, 504, 505, - /* 680 */ 506, 221, 87, 88, 89, 441, 148, 196, 93, 537, - /* 690 */ 152, 438, 518, 98, 99, 100, 101, 545, 193, 104, - /* 700 */ 557, 14, 14, 108, 109, 110, 111, 20, 20, 189, - /* 710 */ 457, 155, 156, 253, 254, 563, 564, 77, 198, 439, - /* 720 */ 568, 569, 202, 203, 57, 211, 439, 440, 208, 209, - /* 730 */ 18, 441, 456, 290, 444, 23, 407, 408, 303, 304, - /* 740 */ 305, 306, 307, 308, 309, 310, 311, 227, 504, 196, - /* 750 */ 194, 195, 476, 477, 42, 43, 427, 22, 46, 76, - /* 760 */ 204, 205, 518, 118, 533, 534, 535, 55, 537, 538, - /* 770 */ 0, 36, 60, 438, 441, 219, 451, 221, 273, 454, - /* 780 */ 500, 446, 226, 85, 72, 73, 74, 75, 76, 255, - /* 790 */ 407, 408, 457, 407, 504, 480, 390, 0, 293, 294, - /* 800 */ 295, 296, 297, 298, 299, 300, 301, 302, 518, 129, - /* 810 */ 427, 255, 256, 257, 44, 259, 260, 261, 262, 263, - /* 820 */ 264, 265, 266, 267, 268, 269, 270, 271, 272, 0, - /* 830 */ 118, 275, 276, 277, 278, 279, 290, 504, 292, 283, - /* 840 */ 284, 285, 286, 287, 288, 289, 290, 12, 13, 71, - /* 850 */ 115, 518, 537, 13, 456, 20, 342, 22, 472, 473, - /* 860 */ 545, 327, 328, 329, 330, 331, 332, 333, 470, 157, - /* 870 */ 0, 36, 537, 38, 476, 477, 36, 393, 563, 564, - /* 880 */ 545, 194, 194, 568, 569, 257, 480, 521, 407, 408, - /* 890 */ 524, 485, 408, 438, 410, 117, 78, 214, 563, 564, - /* 900 */ 122, 403, 408, 568, 569, 407, 71, 409, 427, 74, - /* 910 */ 407, 408, 457, 78, 307, 308, 309, 310, 311, 522, - /* 920 */ 85, 524, 438, 211, 212, 213, 243, 244, 216, 8, - /* 930 */ 9, 0, 438, 12, 13, 14, 15, 16, 454, 0, - /* 940 */ 456, 229, 230, 537, 257, 257, 407, 408, 407, 408, - /* 950 */ 115, 545, 4, 118, 242, 407, 408, 245, 407, 314, - /* 960 */ 248, 249, 250, 251, 252, 462, 427, 189, 47, 563, - /* 970 */ 564, 174, 33, 22, 568, 569, 179, 148, 149, 150, - /* 980 */ 151, 152, 153, 154, 187, 501, 507, 36, 504, 58, - /* 990 */ 155, 156, 508, 509, 510, 511, 512, 513, 416, 507, - /* 1000 */ 516, 517, 518, 462, 510, 407, 408, 523, 13, 525, - /* 1010 */ 462, 407, 408, 529, 530, 536, 1, 435, 148, 149, - /* 1020 */ 150, 151, 152, 153, 154, 427, 314, 445, 536, 194, - /* 1030 */ 195, 427, 407, 408, 19, 439, 85, 407, 408, 204, - /* 1040 */ 205, 490, 491, 8, 9, 407, 408, 12, 13, 14, - /* 1050 */ 15, 16, 427, 38, 219, 439, 221, 427, 36, 407, - /* 1060 */ 408, 226, 412, 413, 2, 427, 115, 393, 53, 54, - /* 1070 */ 8, 9, 57, 255, 12, 13, 14, 15, 16, 427, - /* 1080 */ 85, 66, 67, 68, 69, 193, 71, 20, 416, 23, - /* 1090 */ 255, 256, 257, 439, 259, 260, 261, 262, 263, 264, - /* 1100 */ 265, 266, 267, 268, 269, 270, 271, 272, 407, 408, - /* 1110 */ 275, 276, 277, 278, 279, 49, 50, 445, 283, 284, - /* 1120 */ 285, 286, 287, 288, 289, 12, 13, 14, 454, 393, - /* 1130 */ 407, 408, 117, 20, 4, 22, 480, 122, 407, 408, - /* 1140 */ 455, 456, 4, 150, 408, 438, 410, 154, 429, 36, - /* 1150 */ 427, 38, 433, 23, 119, 8, 9, 19, 427, 12, - /* 1160 */ 13, 14, 15, 16, 457, 273, 393, 438, 153, 13, - /* 1170 */ 219, 52, 221, 44, 438, 446, 38, 414, 48, 49, - /* 1180 */ 50, 408, 71, 410, 71, 293, 457, 74, 62, 63, - /* 1190 */ 454, 438, 456, 537, 431, 57, 407, 408, 85, 446, - /* 1200 */ 71, 545, 64, 65, 3, 442, 255, 256, 33, 71, - /* 1210 */ 457, 438, 522, 198, 524, 200, 427, 393, 203, 563, - /* 1220 */ 564, 228, 47, 208, 568, 569, 233, 454, 115, 456, - /* 1230 */ 237, 118, 239, 122, 533, 534, 535, 501, 537, 538, - /* 1240 */ 504, 85, 227, 221, 508, 509, 510, 511, 512, 513, - /* 1250 */ 407, 408, 516, 517, 518, 117, 20, 425, 22, 523, - /* 1260 */ 122, 525, 480, 196, 316, 529, 530, 393, 155, 156, - /* 1270 */ 427, 14, 15, 16, 501, 253, 254, 504, 454, 412, - /* 1280 */ 413, 508, 509, 510, 511, 512, 513, 421, 422, 516, - /* 1290 */ 517, 518, 80, 81, 82, 33, 523, 61, 525, 87, - /* 1300 */ 88, 89, 529, 530, 428, 93, 438, 194, 195, 47, - /* 1310 */ 98, 99, 100, 101, 438, 196, 104, 204, 205, 537, - /* 1320 */ 108, 109, 110, 111, 257, 449, 207, 545, 454, 421, - /* 1330 */ 422, 20, 219, 0, 221, 20, 8, 9, 0, 226, - /* 1340 */ 12, 13, 14, 15, 16, 563, 564, 394, 8, 9, - /* 1350 */ 568, 569, 12, 13, 14, 15, 16, 393, 8, 9, - /* 1360 */ 393, 439, 12, 13, 14, 15, 16, 499, 255, 256, - /* 1370 */ 257, 393, 259, 260, 261, 262, 263, 264, 265, 266, - /* 1380 */ 267, 268, 269, 270, 271, 272, 33, 47, 275, 276, - /* 1390 */ 277, 278, 279, 396, 397, 20, 283, 284, 285, 286, - /* 1400 */ 287, 288, 289, 12, 13, 407, 408, 393, 407, 408, - /* 1410 */ 393, 20, 22, 22, 451, 480, 451, 454, 454, 454, - /* 1420 */ 273, 454, 408, 439, 410, 427, 36, 36, 427, 38, - /* 1430 */ 407, 408, 454, 0, 393, 148, 149, 150, 151, 152, - /* 1440 */ 153, 154, 14, 0, 407, 408, 407, 408, 20, 408, - /* 1450 */ 427, 410, 438, 407, 408, 407, 408, 148, 393, 119, - /* 1460 */ 439, 152, 71, 438, 427, 74, 427, 33, 454, 119, - /* 1470 */ 456, 454, 537, 427, 449, 427, 85, 8, 9, 438, - /* 1480 */ 545, 12, 13, 14, 15, 16, 8, 9, 36, 13, - /* 1490 */ 12, 13, 14, 15, 16, 454, 158, 456, 563, 564, - /* 1500 */ 393, 393, 33, 568, 569, 115, 115, 196, 393, 118, - /* 1510 */ 119, 173, 36, 393, 393, 501, 393, 393, 504, 454, - /* 1520 */ 393, 393, 508, 509, 510, 511, 512, 513, 393, 393, - /* 1530 */ 516, 517, 518, 393, 4, 408, 33, 523, 337, 525, - /* 1540 */ 55, 466, 501, 529, 530, 504, 155, 156, 129, 508, - /* 1550 */ 509, 510, 511, 512, 513, 33, 36, 516, 517, 518, - /* 1560 */ 123, 454, 454, 126, 523, 438, 525, 539, 257, 454, - /* 1570 */ 529, 530, 257, 123, 454, 454, 126, 454, 454, 33, - /* 1580 */ 247, 454, 454, 456, 54, 194, 195, 0, 119, 454, - /* 1590 */ 454, 158, 0, 0, 454, 204, 205, 119, 33, 572, - /* 1600 */ 123, 158, 183, 126, 123, 85, 231, 126, 0, 22, - /* 1610 */ 219, 33, 221, 33, 22, 22, 33, 226, 33, 8, - /* 1620 */ 9, 51, 119, 12, 13, 14, 15, 16, 501, 561, - /* 1630 */ 22, 504, 554, 1, 2, 508, 509, 510, 511, 512, - /* 1640 */ 513, 119, 36, 516, 517, 518, 255, 256, 257, 33, - /* 1650 */ 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - /* 1660 */ 269, 270, 271, 272, 33, 119, 275, 276, 277, 278, - /* 1670 */ 279, 155, 156, 221, 283, 284, 285, 286, 287, 288, - /* 1680 */ 289, 12, 13, 393, 119, 558, 559, 411, 118, 20, - /* 1690 */ 33, 22, 339, 12, 13, 540, 33, 119, 408, 119, - /* 1700 */ 410, 438, 119, 33, 119, 36, 33, 38, 424, 424, - /* 1710 */ 33, 33, 12, 13, 8, 9, 47, 466, 12, 13, - /* 1720 */ 14, 15, 16, 238, 406, 33, 33, 118, 438, 120, - /* 1730 */ 119, 33, 12, 13, 560, 119, 12, 13, 12, 13, - /* 1740 */ 71, 12, 13, 74, 454, 33, 456, 33, 12, 13, - /* 1750 */ 119, 12, 13, 560, 85, 8, 9, 12, 13, 12, - /* 1760 */ 13, 14, 15, 16, 8, 9, 33, 33, 12, 13, - /* 1770 */ 14, 15, 16, 8, 9, 341, 119, 12, 13, 14, - /* 1780 */ 15, 16, 119, 33, 115, 12, 13, 118, 36, 119, - /* 1790 */ 33, 501, 119, 13, 504, 393, 119, 119, 508, 509, - /* 1800 */ 510, 511, 512, 513, 12, 13, 516, 517, 518, 13, - /* 1810 */ 408, 119, 119, 523, 560, 525, 36, 119, 36, 529, - /* 1820 */ 530, 479, 466, 411, 155, 156, 560, 221, 502, 408, - /* 1830 */ 453, 119, 36, 119, 487, 466, 466, 85, 544, 544, - /* 1840 */ 438, 531, 565, 547, 466, 317, 426, 481, 57, 503, - /* 1850 */ 20, 407, 119, 119, 20, 492, 454, 237, 456, 497, - /* 1860 */ 492, 416, 416, 194, 195, 217, 119, 85, 483, 119, - /* 1870 */ 407, 20, 408, 204, 205, 119, 119, 463, 47, 408, - /* 1880 */ 463, 193, 460, 408, 119, 460, 407, 407, 219, 463, - /* 1890 */ 221, 460, 460, 116, 420, 226, 407, 114, 407, 113, - /* 1900 */ 407, 419, 196, 501, 418, 407, 504, 407, 20, 400, - /* 1910 */ 508, 509, 510, 511, 512, 513, 52, 404, 516, 517, - /* 1920 */ 518, 400, 404, 416, 255, 256, 257, 492, 259, 260, - /* 1930 */ 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - /* 1940 */ 271, 272, 416, 20, 275, 276, 277, 278, 279, 416, - /* 1950 */ 456, 20, 283, 284, 285, 286, 287, 288, 289, 12, - /* 1960 */ 13, 409, 20, 416, 393, 482, 409, 20, 20, 22, - /* 1970 */ 416, 416, 570, 571, 473, 20, 416, 467, 416, 408, - /* 1980 */ 52, 407, 434, 36, 434, 38, 400, 438, 416, 438, - /* 1990 */ 396, 438, 396, 454, 438, 407, 438, 438, 400, 438, - /* 2000 */ 240, 438, 438, 118, 438, 438, 494, 496, 20, 438, - /* 2010 */ 225, 492, 224, 414, 491, 414, 489, 488, 71, 481, - /* 2020 */ 407, 74, 454, 454, 325, 454, 553, 456, 326, 456, - /* 2030 */ 454, 334, 85, 210, 318, 313, 335, 553, 543, 336, - /* 2040 */ 312, 553, 552, 556, 340, 12, 13, 555, 551, 474, - /* 2050 */ 542, 474, 550, 343, 408, 22, 338, 20, 129, 315, - /* 2060 */ 481, 393, 115, 567, 409, 118, 414, 414, 454, 36, - /* 2070 */ 202, 38, 501, 548, 474, 504, 408, 573, 546, 508, - /* 2080 */ 509, 510, 511, 512, 513, 414, 474, 516, 517, 518, - /* 2090 */ 566, 507, 454, 454, 523, 454, 525, 454, 471, 454, - /* 2100 */ 529, 530, 155, 156, 71, 414, 438, 467, 118, 528, - /* 2110 */ 454, 202, 468, 433, 467, 454, 408, 118, 85, 414, - /* 2120 */ 454, 414, 454, 22, 456, 395, 454, 35, 454, 454, - /* 2130 */ 454, 37, 407, 454, 484, 398, 454, 454, 454, 454, - /* 2140 */ 454, 194, 195, 454, 454, 414, 40, 399, 115, 454, - /* 2150 */ 454, 204, 205, 430, 401, 400, 415, 493, 443, 440, - /* 2160 */ 500, 391, 475, 454, 0, 454, 219, 454, 221, 501, - /* 2170 */ 430, 454, 504, 226, 0, 454, 508, 509, 510, 511, - /* 2180 */ 512, 513, 440, 0, 516, 517, 518, 47, 430, 454, - /* 2190 */ 0, 523, 454, 525, 36, 246, 36, 529, 530, 36, - /* 2200 */ 246, 36, 255, 256, 257, 0, 259, 260, 261, 262, - /* 2210 */ 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - /* 2220 */ 36, 475, 275, 276, 277, 278, 279, 36, 246, 36, - /* 2230 */ 283, 284, 285, 286, 287, 288, 289, 12, 13, 0, - /* 2240 */ 0, 246, 0, 36, 0, 20, 36, 22, 0, 22, - /* 2250 */ 0, 36, 219, 241, 221, 0, 227, 0, 227, 221, - /* 2260 */ 228, 36, 219, 38, 0, 0, 0, 393, 215, 214, - /* 2270 */ 0, 0, 161, 51, 51, 0, 0, 36, 0, 36, - /* 2280 */ 0, 57, 408, 51, 0, 47, 0, 0, 255, 256, - /* 2290 */ 0, 0, 0, 0, 0, 0, 71, 51, 0, 74, - /* 2300 */ 179, 0, 179, 36, 0, 0, 0, 0, 275, 276, - /* 2310 */ 85, 0, 438, 0, 0, 0, 283, 284, 285, 286, - /* 2320 */ 287, 288, 0, 0, 0, 0, 0, 0, 454, 0, - /* 2330 */ 456, 0, 0, 0, 0, 0, 51, 0, 0, 0, - /* 2340 */ 115, 0, 0, 118, 47, 0, 0, 0, 0, 0, - /* 2350 */ 0, 0, 22, 0, 0, 161, 160, 159, 0, 0, - /* 2360 */ 52, 52, 22, 0, 0, 22, 0, 71, 0, 0, - /* 2370 */ 71, 71, 36, 71, 0, 501, 57, 0, 504, 0, - /* 2380 */ 155, 156, 508, 509, 510, 511, 512, 513, 36, 0, - /* 2390 */ 516, 517, 518, 36, 0, 0, 36, 523, 0, 525, - /* 2400 */ 44, 57, 14, 529, 530, 44, 44, 36, 36, 0, - /* 2410 */ 0, 56, 393, 33, 47, 0, 0, 44, 0, 194, - /* 2420 */ 195, 51, 57, 45, 210, 0, 51, 408, 44, 204, - /* 2430 */ 205, 44, 51, 51, 0, 0, 51, 0, 0, 0, - /* 2440 */ 44, 36, 0, 57, 219, 44, 221, 36, 57, 0, - /* 2450 */ 36, 226, 44, 0, 57, 36, 57, 438, 0, 0, - /* 2460 */ 0, 44, 79, 0, 0, 36, 0, 0, 36, 22, - /* 2470 */ 0, 59, 22, 454, 22, 456, 36, 36, 33, 36, - /* 2480 */ 255, 256, 257, 22, 259, 260, 261, 262, 263, 264, - /* 2490 */ 265, 266, 267, 268, 269, 270, 271, 272, 36, 0, - /* 2500 */ 275, 276, 277, 278, 279, 36, 33, 36, 283, 284, - /* 2510 */ 285, 286, 287, 288, 289, 12, 13, 36, 393, 36, - /* 2520 */ 501, 128, 36, 504, 0, 22, 126, 508, 509, 510, - /* 2530 */ 511, 512, 513, 408, 36, 516, 517, 518, 36, 36, - /* 2540 */ 36, 38, 22, 0, 525, 393, 0, 22, 529, 530, - /* 2550 */ 22, 36, 0, 0, 0, 36, 0, 36, 0, 36, - /* 2560 */ 408, 0, 22, 438, 20, 36, 36, 36, 0, 51, - /* 2570 */ 119, 0, 118, 118, 71, 36, 0, 22, 0, 454, - /* 2580 */ 0, 456, 22, 33, 3, 393, 196, 319, 22, 51, - /* 2590 */ 438, 119, 118, 118, 52, 119, 118, 52, 119, 196, - /* 2600 */ 408, 36, 196, 36, 114, 118, 454, 116, 456, 202, - /* 2610 */ 33, 119, 393, 119, 118, 33, 196, 196, 118, 118, - /* 2620 */ 33, 51, 33, 118, 232, 119, 501, 408, 226, 504, - /* 2630 */ 438, 319, 206, 508, 509, 510, 511, 512, 513, 206, - /* 2640 */ 33, 516, 517, 518, 231, 222, 454, 85, 456, 36, - /* 2650 */ 525, 119, 118, 501, 529, 530, 504, 438, 3, 33, - /* 2660 */ 508, 509, 510, 511, 512, 513, 119, 119, 516, 517, - /* 2670 */ 518, 36, 36, 454, 36, 456, 36, 525, 36, 36, - /* 2680 */ 51, 529, 530, 119, 33, 51, 0, 0, 119, 44, - /* 2690 */ 118, 0, 119, 501, 119, 0, 504, 118, 44, 33, - /* 2700 */ 508, 509, 510, 511, 512, 513, 118, 515, 516, 517, - /* 2710 */ 518, 199, 118, 203, 119, 118, 199, 44, 116, 291, - /* 2720 */ 501, 116, 219, 504, 221, 198, 2, 508, 509, 510, - /* 2730 */ 511, 512, 513, 303, 22, 516, 517, 518, 118, 255, - /* 2740 */ 118, 319, 118, 118, 525, 118, 0, 51, 118, 530, - /* 2750 */ 119, 119, 119, 51, 22, 118, 253, 254, 255, 118, - /* 2760 */ 44, 0, 118, 22, 118, 118, 118, 258, 118, 393, - /* 2770 */ 51, 119, 119, 199, 118, 118, 118, 118, 275, 276, - /* 2780 */ 120, 118, 121, 118, 408, 118, 283, 284, 285, 286, - /* 2790 */ 287, 288, 22, 119, 118, 232, 119, 393, 36, 129, - /* 2800 */ 36, 118, 36, 119, 119, 36, 118, 36, 119, 119, - /* 2810 */ 36, 119, 408, 36, 438, 140, 118, 33, 140, 140, - /* 2820 */ 140, 118, 36, 118, 22, 22, 79, 78, 22, 36, - /* 2830 */ 454, 36, 456, 36, 36, 36, 36, 36, 85, 112, - /* 2840 */ 36, 36, 438, 36, 36, 85, 112, 33, 36, 36, - /* 2850 */ 22, 0, 36, 36, 478, 36, 36, 85, 454, 36, - /* 2860 */ 456, 36, 36, 36, 22, 36, 36, 36, 57, 0, - /* 2870 */ 36, 0, 36, 0, 0, 57, 44, 501, 57, 44, - /* 2880 */ 504, 393, 44, 36, 508, 509, 510, 511, 512, 513, - /* 2890 */ 57, 36, 516, 517, 518, 0, 408, 44, 22, 0, - /* 2900 */ 22, 36, 0, 22, 36, 501, 36, 22, 504, 393, - /* 2910 */ 33, 21, 508, 509, 510, 511, 512, 513, 22, 22, - /* 2920 */ 516, 517, 518, 20, 408, 21, 438, 574, 574, 574, - /* 2930 */ 393, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 2940 */ 574, 574, 454, 574, 456, 408, 574, 574, 574, 574, - /* 2950 */ 574, 574, 574, 574, 438, 574, 574, 574, 574, 574, - /* 2960 */ 574, 574, 574, 559, 574, 574, 478, 574, 574, 574, - /* 2970 */ 454, 574, 456, 574, 574, 438, 574, 574, 574, 574, - /* 2980 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 501, - /* 2990 */ 574, 454, 504, 456, 478, 574, 508, 509, 510, 511, - /* 3000 */ 512, 513, 574, 574, 516, 517, 518, 574, 574, 574, - /* 3010 */ 574, 574, 574, 574, 574, 574, 574, 501, 574, 574, - /* 3020 */ 504, 393, 574, 574, 508, 509, 510, 511, 512, 513, - /* 3030 */ 574, 574, 516, 517, 518, 574, 408, 574, 501, 574, - /* 3040 */ 574, 504, 393, 574, 574, 508, 509, 510, 511, 512, - /* 3050 */ 513, 574, 574, 516, 517, 518, 574, 408, 574, 574, - /* 3060 */ 574, 574, 393, 574, 574, 574, 438, 574, 574, 574, - /* 3070 */ 574, 574, 574, 574, 574, 574, 574, 408, 574, 574, - /* 3080 */ 574, 574, 454, 574, 456, 574, 574, 438, 574, 574, - /* 3090 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 562, - /* 3100 */ 574, 574, 574, 454, 574, 456, 574, 438, 574, 574, - /* 3110 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 3120 */ 574, 574, 574, 454, 574, 456, 574, 574, 574, 501, - /* 3130 */ 574, 574, 504, 574, 574, 574, 508, 509, 510, 511, - /* 3140 */ 512, 513, 574, 574, 516, 517, 518, 478, 574, 574, - /* 3150 */ 501, 574, 574, 504, 574, 574, 574, 508, 509, 510, - /* 3160 */ 511, 512, 513, 574, 574, 516, 517, 518, 574, 520, - /* 3170 */ 501, 574, 574, 504, 574, 574, 574, 508, 509, 510, - /* 3180 */ 511, 512, 513, 393, 574, 516, 517, 518, 574, 574, - /* 3190 */ 574, 574, 574, 574, 574, 574, 574, 574, 408, 571, - /* 3200 */ 574, 574, 574, 574, 574, 574, 574, 574, 393, 574, - /* 3210 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 3220 */ 574, 574, 574, 408, 574, 574, 574, 574, 438, 574, - /* 3230 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 3240 */ 574, 574, 574, 574, 454, 574, 456, 574, 574, 574, - /* 3250 */ 574, 574, 393, 438, 574, 574, 574, 574, 574, 574, - /* 3260 */ 574, 574, 574, 574, 574, 574, 574, 408, 478, 454, - /* 3270 */ 574, 456, 574, 574, 574, 393, 574, 574, 574, 574, - /* 3280 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 3290 */ 408, 501, 574, 478, 504, 574, 574, 438, 508, 509, - /* 3300 */ 510, 511, 512, 513, 574, 574, 516, 517, 518, 574, - /* 3310 */ 574, 574, 574, 454, 574, 456, 501, 574, 574, 504, - /* 3320 */ 438, 574, 574, 508, 509, 510, 511, 512, 513, 574, - /* 3330 */ 574, 516, 517, 518, 574, 574, 454, 478, 456, 574, - /* 3340 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 3350 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 3360 */ 501, 574, 574, 504, 393, 574, 574, 508, 509, 510, - /* 3370 */ 511, 512, 513, 574, 574, 516, 517, 518, 574, 408, - /* 3380 */ 574, 574, 574, 501, 574, 574, 504, 393, 574, 574, - /* 3390 */ 508, 509, 510, 511, 512, 513, 574, 574, 516, 517, - /* 3400 */ 518, 574, 408, 574, 574, 574, 574, 574, 574, 438, - /* 3410 */ 574, 574, 574, 574, 574, 393, 574, 574, 574, 574, - /* 3420 */ 574, 574, 574, 574, 574, 454, 574, 456, 574, 574, - /* 3430 */ 408, 574, 438, 574, 574, 574, 574, 574, 574, 574, - /* 3440 */ 574, 574, 574, 574, 574, 574, 574, 574, 454, 574, - /* 3450 */ 456, 574, 574, 574, 574, 574, 393, 574, 574, 574, - /* 3460 */ 438, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 3470 */ 574, 408, 501, 574, 574, 504, 454, 574, 456, 508, - /* 3480 */ 509, 510, 511, 512, 513, 574, 574, 516, 517, 518, - /* 3490 */ 574, 574, 574, 574, 574, 501, 574, 574, 504, 393, - /* 3500 */ 574, 438, 508, 509, 510, 511, 512, 513, 574, 574, - /* 3510 */ 516, 517, 518, 574, 408, 574, 574, 454, 574, 456, - /* 3520 */ 574, 574, 574, 501, 574, 574, 504, 574, 574, 574, - /* 3530 */ 508, 509, 510, 511, 512, 513, 574, 574, 516, 517, - /* 3540 */ 518, 393, 574, 574, 438, 574, 574, 574, 574, 574, - /* 3550 */ 574, 574, 574, 574, 574, 574, 408, 574, 574, 574, - /* 3560 */ 454, 574, 456, 574, 501, 574, 574, 504, 574, 574, - /* 3570 */ 574, 508, 509, 510, 511, 512, 513, 574, 574, 516, - /* 3580 */ 517, 518, 574, 574, 574, 574, 438, 574, 574, 574, - /* 3590 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 3600 */ 574, 574, 454, 574, 456, 574, 574, 501, 574, 574, - /* 3610 */ 504, 574, 574, 574, 508, 509, 510, 511, 512, 513, - /* 3620 */ 574, 574, 516, 517, 518, 574, 574, 574, 574, 574, - /* 3630 */ 574, 574, 574, 574, 574, 574, 574, 574, 393, 574, - /* 3640 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 501, - /* 3650 */ 574, 574, 504, 408, 574, 574, 508, 509, 510, 511, - /* 3660 */ 512, 513, 393, 574, 516, 517, 518, 574, 574, 574, - /* 3670 */ 574, 574, 574, 574, 574, 574, 574, 408, 574, 574, - /* 3680 */ 574, 574, 574, 438, 574, 574, 574, 393, 574, 574, - /* 3690 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 454, - /* 3700 */ 574, 456, 408, 574, 574, 574, 574, 438, 574, 574, - /* 3710 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 3720 */ 574, 574, 574, 454, 574, 456, 574, 393, 574, 574, - /* 3730 */ 574, 574, 438, 574, 574, 574, 574, 574, 574, 574, - /* 3740 */ 574, 574, 408, 574, 574, 574, 501, 574, 454, 504, - /* 3750 */ 456, 574, 574, 508, 509, 510, 511, 512, 513, 574, - /* 3760 */ 574, 516, 517, 518, 574, 574, 574, 574, 574, 393, - /* 3770 */ 501, 574, 438, 504, 574, 574, 574, 508, 509, 510, - /* 3780 */ 511, 512, 513, 574, 408, 516, 517, 518, 454, 574, - /* 3790 */ 456, 574, 574, 574, 393, 501, 574, 574, 504, 574, - /* 3800 */ 574, 574, 508, 509, 510, 511, 512, 513, 574, 408, - /* 3810 */ 516, 517, 518, 574, 438, 574, 574, 574, 574, 574, - /* 3820 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 3830 */ 454, 574, 456, 574, 574, 501, 574, 574, 504, 438, - /* 3840 */ 574, 574, 508, 509, 510, 511, 512, 513, 574, 574, - /* 3850 */ 516, 517, 518, 574, 574, 454, 574, 456, 574, 574, - /* 3860 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 3870 */ 574, 574, 574, 574, 574, 393, 574, 501, 574, 574, - /* 3880 */ 504, 574, 574, 574, 508, 509, 510, 511, 512, 513, - /* 3890 */ 408, 574, 516, 517, 518, 574, 574, 574, 574, 574, - /* 3900 */ 393, 574, 501, 574, 574, 504, 574, 574, 574, 508, - /* 3910 */ 509, 510, 511, 512, 513, 408, 574, 516, 517, 518, - /* 3920 */ 438, 574, 574, 574, 393, 574, 574, 574, 574, 574, - /* 3930 */ 574, 574, 574, 574, 574, 574, 454, 574, 456, 408, - /* 3940 */ 574, 574, 574, 574, 574, 438, 574, 574, 574, 574, - /* 3950 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 3960 */ 574, 454, 574, 456, 574, 393, 574, 574, 574, 438, - /* 3970 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 3980 */ 408, 574, 574, 501, 574, 454, 504, 456, 574, 574, - /* 3990 */ 508, 509, 510, 511, 512, 513, 574, 574, 516, 517, - /* 4000 */ 518, 574, 574, 574, 574, 574, 574, 574, 501, 574, - /* 4010 */ 438, 504, 574, 574, 574, 508, 509, 510, 511, 512, - /* 4020 */ 513, 574, 574, 516, 517, 518, 454, 574, 456, 574, - /* 4030 */ 574, 574, 501, 574, 574, 504, 574, 574, 574, 508, - /* 4040 */ 509, 510, 511, 512, 513, 574, 393, 516, 517, 518, - /* 4050 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 4060 */ 574, 408, 574, 574, 574, 574, 574, 574, 574, 574, - /* 4070 */ 574, 393, 574, 501, 574, 574, 504, 574, 574, 574, - /* 4080 */ 508, 509, 510, 511, 512, 513, 408, 574, 516, 517, - /* 4090 */ 518, 438, 574, 574, 574, 393, 574, 574, 574, 574, - /* 4100 */ 574, 574, 574, 574, 574, 574, 574, 454, 574, 456, - /* 4110 */ 408, 574, 574, 574, 574, 574, 438, 574, 574, 574, - /* 4120 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 4130 */ 574, 574, 454, 574, 456, 574, 393, 574, 574, 574, - /* 4140 */ 438, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 4150 */ 574, 408, 574, 574, 501, 574, 454, 504, 456, 574, - /* 4160 */ 574, 508, 509, 510, 511, 512, 513, 574, 574, 516, - /* 4170 */ 517, 518, 574, 574, 574, 574, 574, 574, 393, 501, - /* 4180 */ 574, 438, 504, 574, 574, 574, 508, 509, 510, 511, - /* 4190 */ 512, 513, 574, 408, 516, 517, 518, 454, 574, 456, - /* 4200 */ 574, 393, 574, 501, 574, 574, 504, 574, 574, 574, - /* 4210 */ 508, 509, 510, 511, 512, 513, 408, 574, 516, 517, - /* 4220 */ 518, 574, 574, 438, 574, 574, 574, 574, 574, 574, - /* 4230 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 454, - /* 4240 */ 574, 456, 574, 574, 501, 574, 438, 504, 574, 574, - /* 4250 */ 574, 508, 509, 510, 511, 512, 513, 574, 574, 516, - /* 4260 */ 517, 518, 454, 574, 456, 574, 574, 574, 574, 393, - /* 4270 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 4280 */ 574, 574, 574, 574, 408, 574, 501, 574, 574, 504, - /* 4290 */ 574, 574, 574, 508, 509, 510, 511, 512, 513, 574, - /* 4300 */ 574, 516, 517, 518, 574, 574, 574, 393, 574, 501, - /* 4310 */ 574, 574, 504, 574, 438, 574, 508, 509, 510, 511, - /* 4320 */ 512, 513, 408, 574, 516, 517, 518, 574, 574, 574, - /* 4330 */ 454, 574, 456, 574, 574, 574, 574, 574, 574, 574, - /* 4340 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 4350 */ 574, 574, 438, 574, 574, 574, 574, 574, 574, 574, - /* 4360 */ 574, 574, 574, 574, 574, 574, 574, 574, 454, 574, - /* 4370 */ 456, 574, 574, 574, 574, 574, 574, 501, 574, 574, - /* 4380 */ 504, 574, 574, 574, 508, 509, 510, 511, 512, 513, - /* 4390 */ 574, 574, 516, 517, 518, 574, 574, 574, 574, 574, - /* 4400 */ 574, 574, 393, 574, 574, 574, 574, 574, 574, 574, - /* 4410 */ 574, 574, 574, 574, 574, 501, 574, 408, 504, 574, - /* 4420 */ 574, 574, 508, 509, 510, 511, 512, 513, 574, 393, - /* 4430 */ 516, 517, 518, 574, 574, 574, 574, 574, 574, 574, - /* 4440 */ 574, 574, 574, 574, 408, 574, 574, 438, 574, 574, - /* 4450 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 4460 */ 574, 574, 574, 454, 574, 456, 574, 393, 574, 574, - /* 4470 */ 574, 574, 574, 574, 438, 574, 574, 574, 574, 574, - /* 4480 */ 574, 574, 408, 574, 574, 574, 574, 574, 574, 574, - /* 4490 */ 454, 574, 456, 574, 574, 574, 574, 574, 574, 574, - /* 4500 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 4510 */ 501, 574, 438, 504, 574, 574, 574, 508, 509, 510, - /* 4520 */ 511, 512, 513, 574, 574, 516, 517, 518, 454, 574, - /* 4530 */ 456, 574, 574, 574, 574, 574, 574, 501, 574, 574, - /* 4540 */ 504, 574, 574, 574, 508, 509, 510, 511, 512, 513, - /* 4550 */ 393, 574, 516, 517, 518, 574, 574, 574, 574, 574, - /* 4560 */ 574, 574, 574, 574, 574, 408, 574, 574, 574, 574, - /* 4570 */ 574, 574, 574, 393, 574, 501, 574, 574, 504, 574, - /* 4580 */ 574, 574, 508, 509, 510, 511, 512, 513, 408, 574, - /* 4590 */ 516, 517, 518, 393, 574, 438, 574, 574, 574, 574, - /* 4600 */ 574, 574, 574, 574, 574, 574, 574, 574, 408, 574, - /* 4610 */ 574, 454, 574, 456, 574, 574, 574, 574, 438, 574, - /* 4620 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 4630 */ 574, 574, 574, 574, 454, 574, 456, 574, 438, 574, - /* 4640 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 4650 */ 574, 574, 574, 574, 454, 574, 456, 574, 501, 574, - /* 4660 */ 574, 504, 574, 574, 574, 508, 509, 510, 511, 512, - /* 4670 */ 513, 574, 574, 516, 517, 518, 574, 574, 574, 574, - /* 4680 */ 574, 501, 574, 574, 504, 574, 574, 574, 508, 509, - /* 4690 */ 510, 511, 512, 513, 574, 574, 516, 517, 518, 574, - /* 4700 */ 574, 501, 574, 574, 504, 574, 574, 574, 508, 509, - /* 4710 */ 510, 511, 512, 513, 574, 574, 516, 517, 518, 390, - /* 4720 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4730 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4740 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4750 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4760 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4770 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4780 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4790 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4800 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4810 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4820 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4830 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4840 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4850 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4860 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4870 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4880 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4890 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4900 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4910 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4920 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4930 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4940 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4950 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4960 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4970 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4980 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 4990 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 5000 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 5010 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 5020 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 5030 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 5040 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 5050 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 5060 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 5070 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 5080 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 5090 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - /* 5100 */ 390, 390, 390, 390, 390, 390, 390, 390, 390, -}; -#define YY_SHIFT_COUNT (1025) -#define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2904) -static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 712, 278, 556, 278, 835, 835, 835, 835, 835, 835, - /* 10 */ 835, 835, 835, 835, 835, 835, 1113, 1947, 1947, 2225, - /* 20 */ 0, 1391, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, - /* 30 */ 1947, 1947, 1669, 1947, 1947, 1947, 1947, 1947, 1947, 1947, - /* 40 */ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, - /* 50 */ 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, - /* 60 */ 1947, 1947, 1947, 34, 156, 246, 97, 6, 121, 6, - /* 70 */ 6, 97, 97, 6, 2033, 6, 277, 2033, 645, 6, - /* 80 */ 133, 2503, 416, 416, 170, 170, 2503, 2503, 1130, 1130, - /* 90 */ 416, 8, 8, 360, 348, 348, 628, 93, 170, 170, - /* 100 */ 170, 170, 170, 170, 170, 170, 170, 170, 170, 234, - /* 110 */ 375, 440, 170, 170, 219, 133, 170, 234, 170, 133, - /* 120 */ 170, 170, 170, 170, 133, 170, 170, 170, 133, 170, - /* 130 */ 133, 133, 133, 640, 505, 505, 99, 99, 470, 1212, - /* 140 */ 435, 51, 951, 951, 951, 951, 951, 951, 951, 951, - /* 150 */ 951, 951, 951, 951, 951, 951, 951, 951, 951, 951, - /* 160 */ 951, 538, 491, 8, 360, 1126, 1126, 467, 553, 553, - /* 170 */ 553, 546, 546, 388, 995, 467, 219, 133, 441, 133, - /* 180 */ 133, 443, 133, 133, 698, 133, 698, 698, 680, 10, - /* 190 */ 1015, 99, 99, 99, 99, 99, 99, 595, 21, 53, - /* 200 */ 182, 182, 514, 534, 23, 607, 609, 66, 687, 688, - /* 210 */ 415, 415, 1066, 1067, 135, 135, 135, 1119, 135, 318, - /* 220 */ 1311, 1236, 1129, 1428, 1309, 112, 302, 302, 1315, 1156, - /* 230 */ 1156, 1201, 1175, 948, 302, 995, 1528, 1791, 1830, 1834, - /* 240 */ 1620, 219, 1834, 219, 1648, 1830, 1851, 1831, 1851, 1831, - /* 250 */ 1688, 1830, 1851, 1830, 1831, 1688, 1688, 1688, 1777, 1783, - /* 260 */ 1830, 1830, 1786, 1830, 1830, 1830, 1888, 1864, 1888, 1864, - /* 270 */ 1834, 219, 219, 1923, 219, 1931, 1942, 219, 1931, 219, - /* 280 */ 1948, 219, 1955, 219, 219, 1928, 1928, 1830, 219, 1888, - /* 290 */ 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, - /* 300 */ 133, 1830, 10, 10, 1888, 698, 698, 698, 1760, 1885, - /* 310 */ 1834, 640, 1988, 1785, 1788, 1923, 640, 1528, 1830, 698, - /* 320 */ 1702, 1699, 1702, 1699, 1697, 1823, 1702, 1703, 1701, 1716, - /* 330 */ 1528, 1722, 1728, 1710, 1704, 1718, 1851, 2037, 1929, 1744, - /* 340 */ 1931, 640, 640, 1699, 698, 698, 698, 698, 1699, 698, - /* 350 */ 1868, 640, 698, 1955, 640, 1990, 698, 1909, 1955, 640, - /* 360 */ 680, 640, 1851, 698, 698, 698, 698, 698, 698, 698, - /* 370 */ 698, 698, 698, 698, 698, 698, 698, 698, 698, 698, - /* 380 */ 698, 698, 698, 698, 698, 1999, 698, 1830, 640, 2101, - /* 390 */ 2092, 2094, 2106, 1888, 4719, 4719, 4719, 4719, 4719, 4719, - /* 400 */ 4719, 4719, 4719, 4719, 4719, 4719, 39, 520, 299, 1138, - /* 410 */ 78, 1469, 87, 1340, 1035, 1350, 1478, 1611, 610, 493, - /* 420 */ 1062, 1747, 921, 1756, 1765, 1147, 1706, 829, 870, 1328, - /* 430 */ 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1328, 1287, 68, - /* 440 */ 993, 22, 3, 3, 683, 778, 797, 236, 164, 460, - /* 450 */ 1022, 1338, 735, 1390, 38, 38, 1257, 58, 892, 1257, - /* 460 */ 1257, 1257, 667, 1333, 477, 770, 1262, 1419, 1433, 1443, - /* 470 */ 1530, 939, 1437, 1375, 1450, 1477, 1375, 1481, 1520, 840, - /* 480 */ 1476, 1587, 1592, 1593, 1608, 1485, 1503, 1522, 1111, 1546, - /* 490 */ 1565, 1578, 1580, 1516, 1353, 1434, 1583, 1585, 1616, 1631, - /* 500 */ 1632, 1657, 818, 1663, 1670, 1673, 1570, 1677, 1678, 1692, - /* 510 */ 1693, 1698, 1681, 1700, 1720, 1724, 1726, 1729, 1736, 1739, - /* 520 */ 1745, 1773, 1792, 1712, 1375, 1714, 1733, 1734, 1750, 1757, - /* 530 */ 1609, 1752, 1452, 1606, 1780, 1796, 1782, 931, 2164, 2174, - /* 540 */ 2183, 2140, 2190, 2158, 1949, 2160, 2163, 2165, 1954, 2205, - /* 550 */ 2184, 2191, 1982, 2193, 2239, 2240, 1995, 2242, 2207, 2244, - /* 560 */ 2210, 2248, 2227, 2250, 2215, 2012, 2255, 2029, 2257, 2031, - /* 570 */ 2032, 2038, 2043, 2264, 2265, 2266, 2053, 2055, 2270, 2271, - /* 580 */ 2111, 2222, 2223, 2275, 2241, 2276, 2278, 2243, 2224, 2280, - /* 590 */ 2232, 2284, 2238, 2286, 2287, 2290, 2246, 2291, 2292, 2293, - /* 600 */ 2294, 2295, 2298, 2121, 2267, 2301, 2123, 2304, 2305, 2306, - /* 610 */ 2307, 2311, 2313, 2314, 2315, 2322, 2323, 2324, 2325, 2326, - /* 620 */ 2327, 2329, 2331, 2332, 2333, 2334, 2335, 2285, 2337, 2297, - /* 630 */ 2338, 2339, 2341, 2342, 2345, 2346, 2347, 2348, 2349, 2350, - /* 640 */ 2330, 2351, 2194, 2353, 2196, 2354, 2198, 2358, 2359, 2340, - /* 650 */ 2308, 2343, 2309, 2363, 2296, 2364, 2299, 2336, 2366, 2300, - /* 660 */ 2368, 2302, 2369, 2374, 2352, 2319, 2356, 2377, 2357, 2344, - /* 670 */ 2361, 2379, 2360, 2365, 2362, 2389, 2371, 2394, 2355, 2395, - /* 680 */ 2372, 2398, 2367, 2373, 2380, 2370, 2375, 2388, 2381, 2409, - /* 690 */ 2378, 2384, 2410, 2415, 2416, 2418, 2387, 2214, 2425, 2370, - /* 700 */ 2382, 2434, 2370, 2385, 2435, 2437, 2383, 2438, 2439, 2405, - /* 710 */ 2386, 2396, 2442, 2411, 2391, 2401, 2449, 2414, 2397, 2408, - /* 720 */ 2453, 2419, 2399, 2417, 2458, 2459, 2460, 2463, 2464, 2429, - /* 730 */ 2466, 2467, 2393, 2400, 2432, 2447, 2470, 2450, 2440, 2441, - /* 740 */ 2443, 2462, 2469, 2471, 2481, 2483, 2486, 2445, 2473, 2498, - /* 750 */ 2502, 2452, 2504, 2499, 2461, 2524, 2520, 2543, 2525, 2412, - /* 760 */ 2546, 2528, 2515, 2552, 2553, 2554, 2519, 2556, 2521, 2558, - /* 770 */ 2523, 2561, 2540, 2544, 2529, 2530, 2531, 2451, 2454, 2568, - /* 780 */ 2390, 2392, 2413, 2455, 2402, 2370, 2518, 2571, 2403, 2539, - /* 790 */ 2555, 2576, 2423, 2560, 2406, 2407, 2578, 2580, 2420, 2426, - /* 800 */ 2421, 2433, 2581, 2550, 2268, 2474, 2472, 2475, 2476, 2566, - /* 810 */ 2478, 2479, 2565, 2567, 2487, 2542, 2491, 2545, 2490, 2492, - /* 820 */ 2577, 2582, 2494, 2496, 2500, 2501, 2506, 2587, 2538, 2570, - /* 830 */ 2505, 2589, 2312, 2562, 2532, 2607, 2534, 2613, 2547, 2548, - /* 840 */ 2655, 2626, 2422, 2635, 2636, 2638, 2640, 2642, 2643, 2564, - /* 850 */ 2569, 2629, 2430, 2651, 2634, 2686, 2687, 2572, 2645, 2573, - /* 860 */ 2575, 2579, 2588, 2512, 2594, 2691, 2654, 2510, 2695, 2595, - /* 870 */ 2597, 2517, 2673, 2527, 2666, 2602, 2428, 2605, 2724, 2712, - /* 880 */ 2484, 2620, 2622, 2624, 2625, 2627, 2631, 2632, 2630, 2637, - /* 890 */ 2641, 2644, 2646, 2633, 2696, 2647, 2648, 2702, 2652, 2732, - /* 900 */ 2509, 2650, 2656, 2746, 2653, 2657, 2574, 2716, 2658, 2660, - /* 910 */ 2761, 2741, 2661, 2659, 2370, 2719, 2663, 2665, 2674, 2667, - /* 920 */ 2676, 2670, 2770, 2563, 2677, 2762, 2764, 2683, 2684, 2766, - /* 930 */ 2688, 2685, 2769, 2630, 2689, 2771, 2637, 2690, 2774, 2641, - /* 940 */ 2692, 2777, 2644, 2675, 2678, 2679, 2680, 2698, 2784, 2703, - /* 950 */ 2786, 2705, 2784, 2784, 2802, 2747, 2749, 2803, 2806, 2793, - /* 960 */ 2795, 2797, 2798, 2799, 2800, 2801, 2804, 2805, 2807, 2808, - /* 970 */ 2753, 2727, 2760, 2734, 2814, 2812, 2813, 2816, 2828, 2817, - /* 980 */ 2819, 2820, 2772, 2445, 2823, 2473, 2825, 2826, 2827, 2829, - /* 990 */ 2842, 2830, 2851, 2831, 2811, 2832, 2869, 2834, 2818, 2835, - /* 1000 */ 2871, 2836, 2821, 2838, 2873, 2847, 2833, 2853, 2874, 2855, - /* 1010 */ 2895, 2876, 2899, 2878, 2865, 2902, 2881, 2877, 2868, 2870, - /* 1020 */ 2885, 2890, 2896, 2897, 2904, 2903, -}; -#define YY_REDUCE_COUNT (405) -#define YY_REDUCE_MIN (-537) -#define YY_REDUCE_MAX (4200) -static const short yy_reduce_ofst[] = { - /* 0 */ 406, -350, -99, 143, 484, 736, 773, 1014, 1041, 1290, - /* 10 */ 1571, 1668, 1874, 2019, 2125, 2152, -135, 1127, 1402, 2219, - /* 20 */ 2192, 2376, 2404, 2488, 2516, 2537, 2628, 2649, 2669, 2790, - /* 30 */ 2815, 2859, 2882, 2971, 2994, 3022, 3063, 3106, 3148, 3245, - /* 40 */ 3269, 3294, 3334, 3376, 3401, 3482, 3507, 3531, 3572, 3653, - /* 50 */ 3678, 3702, 3743, 3785, 3808, 3876, 3914, 4009, 4036, 4074, - /* 60 */ 4157, 4180, 4200, -352, 335, -148, -57, 152, 315, 656, - /* 70 */ 782, 231, 701, 935, 174, -537, -211, -340, -535, -178, - /* 80 */ -247, 290, -69, 398, -238, -4, 244, 333, -401, -399, - /* 90 */ 276, -408, -368, -415, -49, 498, 494, 329, 383, 481, - /* 100 */ 539, 598, 503, 541, 604, 625, 630, 638, 548, -179, - /* 110 */ 386, -295, 652, 723, 582, 33, 731, 551, 789, 212, - /* 120 */ 843, 998, 1001, 1023, 1, 1037, 1039, 1046, 729, 1048, - /* 130 */ -130, 753, 876, 763, -2, -2, 287, 280, -425, 165, - /* 140 */ -530, -167, 674, 824, 874, 964, 967, 978, 1017, 1065, - /* 150 */ 1107, 1108, 1115, 1120, 1121, 1123, 1124, 1128, 1135, 1136, - /* 160 */ 1140, 47, 128, -73, 685, 650, 867, 866, 128, 479, - /* 170 */ 492, 397, 690, -379, 217, 908, 672, 868, 151, 253, - /* 180 */ 455, 366, 1025, -230, 325, 707, 963, 965, 719, 997, - /* 190 */ -463, 596, 616, 654, 922, 984, 1021, 832, 953, 1075, - /* 200 */ 1028, 1028, 1027, 1068, 1078, 1155, 1276, 1028, 1263, 1263, - /* 210 */ 1284, 1285, 1318, 1251, 1174, 1193, 1254, 1342, 1266, 1263, - /* 220 */ 1356, 1412, 1326, 1421, 1377, 1347, 1369, 1370, 1263, 1294, - /* 230 */ 1295, 1277, 1310, 1296, 1378, 1420, 1366, 1346, 1444, 1363, - /* 240 */ 1362, 1445, 1368, 1446, 1385, 1463, 1464, 1414, 1471, 1417, - /* 250 */ 1422, 1479, 1475, 1480, 1426, 1425, 1431, 1432, 1474, 1482, - /* 260 */ 1489, 1491, 1486, 1493, 1498, 1500, 1509, 1513, 1521, 1518, - /* 270 */ 1435, 1507, 1526, 1494, 1533, 1552, 1483, 1547, 1557, 1554, - /* 280 */ 1501, 1555, 1510, 1560, 1562, 1548, 1550, 1574, 1572, 1586, - /* 290 */ 1549, 1551, 1553, 1556, 1558, 1559, 1561, 1563, 1564, 1566, - /* 300 */ 1567, 1588, 1594, 1596, 1598, 1539, 1568, 1569, 1511, 1512, - /* 310 */ 1519, 1599, 1523, 1527, 1529, 1573, 1601, 1538, 1613, 1576, - /* 320 */ 1473, 1575, 1484, 1577, 1487, 1492, 1488, 1490, 1497, 1502, - /* 330 */ 1579, 1495, 1508, 1504, 1496, 1524, 1646, 1584, 1525, 1532, - /* 340 */ 1655, 1652, 1653, 1600, 1614, 1638, 1639, 1641, 1612, 1643, - /* 350 */ 1627, 1671, 1645, 1640, 1691, 1581, 1656, 1644, 1647, 1705, - /* 360 */ 1680, 1707, 1708, 1661, 1666, 1672, 1674, 1675, 1676, 1679, - /* 370 */ 1682, 1683, 1684, 1685, 1686, 1689, 1690, 1695, 1696, 1709, - /* 380 */ 1711, 1713, 1717, 1721, 1735, 1715, 1738, 1725, 1731, 1730, - /* 390 */ 1737, 1748, 1753, 1755, 1650, 1719, 1660, 1664, 1687, 1746, - /* 400 */ 1723, 1740, 1742, 1758, 1741, 1770, -}; -static const YYACTIONTYPE yy_default[] = { - /* 0 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 10 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 20 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 30 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 40 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 50 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 60 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 70 */ 2305, 2305, 2305, 2689, 2305, 2305, 2645, 2305, 2305, 2305, - /* 80 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 90 */ 2305, 2652, 2652, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 100 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 110 */ 2305, 2305, 2305, 2305, 2415, 2305, 2305, 2305, 2305, 2305, - /* 120 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 130 */ 2305, 2305, 2305, 2413, 2963, 2305, 3091, 2730, 2305, 2305, - /* 140 */ 2992, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 150 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 160 */ 2305, 2305, 2975, 2305, 2305, 2386, 2386, 2305, 2975, 2975, - /* 170 */ 2975, 2935, 2935, 2413, 2305, 2305, 2415, 2305, 2732, 2305, - /* 180 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2559, 2335, - /* 190 */ 2715, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 3021, - /* 200 */ 2967, 2968, 3085, 2305, 3024, 2986, 2305, 2981, 2305, 2305, - /* 210 */ 2305, 2305, 2305, 3011, 2305, 2305, 2305, 2305, 2305, 2305, - /* 220 */ 2657, 2305, 2759, 2305, 2502, 2709, 2305, 2305, 2305, 2305, - /* 230 */ 2305, 3069, 2965, 3005, 2305, 2305, 3015, 2305, 2305, 2305, - /* 240 */ 2747, 2415, 2305, 2415, 2702, 2640, 2305, 2650, 2305, 2650, - /* 250 */ 2647, 2305, 2305, 2305, 2650, 2647, 2647, 2647, 2490, 2486, - /* 260 */ 2305, 2305, 2484, 2305, 2305, 2305, 2305, 2365, 2305, 2365, - /* 270 */ 2305, 2415, 2415, 2305, 2415, 2305, 2305, 2415, 2305, 2415, - /* 280 */ 2305, 2415, 2305, 2415, 2415, 2519, 2519, 2305, 2415, 2305, - /* 290 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 300 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2745, 2725, - /* 310 */ 2305, 2413, 2305, 2713, 2711, 2305, 2413, 3015, 2305, 2305, - /* 320 */ 3039, 3034, 3039, 3034, 3053, 3049, 3039, 3058, 3055, 3017, - /* 330 */ 3015, 2998, 2994, 3088, 3075, 3071, 2305, 2305, 3003, 3001, - /* 340 */ 2305, 2413, 2413, 3034, 2305, 2305, 2305, 2305, 3034, 2305, - /* 350 */ 2305, 2413, 2305, 2305, 2413, 2305, 2305, 2305, 2305, 2413, - /* 360 */ 2305, 2413, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 370 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 380 */ 2305, 2305, 2305, 2305, 2305, 2521, 2305, 2305, 2413, 2305, - /* 390 */ 2337, 2339, 2349, 2305, 2704, 3091, 2730, 2735, 2685, 2685, - /* 400 */ 2562, 2562, 3091, 2562, 2416, 2310, 2305, 2305, 2305, 2305, - /* 410 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 420 */ 2305, 2305, 2864, 2305, 2305, 2305, 2305, 2305, 2305, 3052, - /* 430 */ 3051, 2865, 2305, 2939, 2938, 2937, 2928, 2864, 2515, 2305, - /* 440 */ 2305, 2305, 2863, 2862, 2305, 2305, 2305, 2305, 2305, 2305, - /* 450 */ 2305, 2305, 2305, 2305, 2676, 2675, 2856, 2305, 2305, 2857, - /* 460 */ 2855, 2854, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 470 */ 2305, 2305, 2305, 2506, 2305, 2305, 2503, 2305, 2305, 2305, - /* 480 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 490 */ 2305, 2305, 2305, 2305, 3072, 3076, 2305, 2305, 2305, 2305, - /* 500 */ 2964, 2305, 2305, 2305, 2305, 2305, 2835, 2305, 2305, 2305, - /* 510 */ 2305, 2305, 2803, 2798, 2789, 2780, 2795, 2786, 2774, 2792, - /* 520 */ 2783, 2771, 2768, 2305, 2530, 2305, 2305, 2305, 2305, 2305, - /* 530 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 540 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 550 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 560 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 570 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 580 */ 2646, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 590 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 600 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 610 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 620 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 630 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 640 */ 2305, 2305, 2305, 2305, 2305, 2305, 2661, 2305, 2305, 2305, - /* 650 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 660 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 670 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 680 */ 2305, 2305, 2305, 2305, 2354, 2842, 2305, 2305, 2305, 2305, - /* 690 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2845, - /* 700 */ 2305, 2305, 2846, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 710 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 720 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 730 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 740 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2461, 2460, 2305, - /* 750 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 760 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 770 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2847, 2305, 2305, - /* 780 */ 2305, 2305, 2729, 2305, 2305, 2837, 2305, 2305, 2305, 2305, - /* 790 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 800 */ 2305, 2305, 3068, 3018, 2305, 2305, 2305, 2305, 2305, 2305, - /* 810 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 820 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2835, - /* 830 */ 2305, 3050, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 3066, - /* 840 */ 2305, 3070, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2974, - /* 850 */ 2970, 2305, 2305, 2966, 2305, 2305, 2305, 2305, 2305, 2305, - /* 860 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 870 */ 2305, 2305, 2305, 2305, 2925, 2305, 2305, 2305, 2959, 2305, - /* 880 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2558, 2557, - /* 890 */ 2556, 2555, 2305, 2305, 2305, 2305, 2305, 2305, 2847, 2305, - /* 900 */ 2850, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 910 */ 2305, 2305, 2305, 2305, 2834, 2305, 2902, 2901, 2305, 2305, - /* 920 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2552, 2305, 2305, - /* 930 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 940 */ 2305, 2305, 2305, 2536, 2534, 2533, 2532, 2305, 2569, 2305, - /* 950 */ 2305, 2305, 2565, 2564, 2305, 2305, 2305, 2305, 2305, 2305, - /* 960 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 970 */ 2305, 2305, 2305, 2305, 2434, 2305, 2305, 2305, 2305, 2305, - /* 980 */ 2305, 2305, 2305, 2426, 2305, 2425, 2305, 2305, 2305, 2305, - /* 990 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 1000 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2305, - /* 1010 */ 2305, 2305, 2305, 2305, 2305, 2305, 2305, 2334, 2305, 2305, - /* 1020 */ 2305, 2305, 2305, 2305, 2305, 2305, -}; -/********** 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[] = { - 0, /* $ => nothing */ - 0, /* OR => nothing */ - 0, /* AND => nothing */ - 0, /* UNION => nothing */ - 0, /* ALL => nothing */ - 0, /* MINUS => nothing */ - 0, /* EXCEPT => nothing */ - 0, /* INTERSECT => nothing */ - 0, /* NK_BITAND => nothing */ - 0, /* NK_BITOR => nothing */ - 0, /* NK_LSHIFT => nothing */ - 0, /* NK_RSHIFT => nothing */ - 0, /* NK_PLUS => nothing */ - 0, /* NK_MINUS => nothing */ - 0, /* NK_STAR => nothing */ - 0, /* NK_SLASH => nothing */ - 0, /* NK_REM => nothing */ - 0, /* NK_CONCAT => nothing */ - 0, /* CREATE => nothing */ - 0, /* ACCOUNT => nothing */ - 0, /* NK_ID => nothing */ - 0, /* PASS => nothing */ - 0, /* NK_STRING => nothing */ - 0, /* ALTER => nothing */ - 0, /* PPS => nothing */ - 0, /* TSERIES => nothing */ - 0, /* STORAGE => nothing */ - 0, /* STREAMS => nothing */ - 0, /* QTIME => nothing */ - 0, /* DBS => nothing */ - 0, /* USERS => nothing */ - 0, /* CONNS => nothing */ - 0, /* STATE => nothing */ - 0, /* NK_COMMA => nothing */ - 0, /* HOST => nothing */ - 0, /* IS_IMPORT => nothing */ - 0, /* NK_INTEGER => nothing */ - 0, /* CREATEDB => nothing */ - 0, /* USER => nothing */ - 0, /* ENABLE => nothing */ - 0, /* SYSINFO => nothing */ - 0, /* ADD => nothing */ - 0, /* DROP => nothing */ - 0, /* GRANT => nothing */ - 0, /* ON => nothing */ - 0, /* TO => nothing */ - 0, /* REVOKE => nothing */ - 0, /* FROM => nothing */ - 0, /* SUBSCRIBE => nothing */ - 0, /* READ => nothing */ - 0, /* WRITE => nothing */ - 0, /* NK_DOT => nothing */ - 0, /* WITH => nothing */ - 0, /* ENCRYPT_KEY => nothing */ - 0, /* ANODE => nothing */ - 0, /* UPDATE => nothing */ - 0, /* ANODES => nothing */ - 0, /* DNODE => nothing */ - 0, /* PORT => nothing */ - 0, /* DNODES => nothing */ - 0, /* RESTORE => nothing */ - 0, /* NK_IPTOKEN => nothing */ - 0, /* FORCE => nothing */ - 0, /* UNSAFE => nothing */ - 0, /* CLUSTER => nothing */ - 0, /* LOCAL => nothing */ - 0, /* QNODE => nothing */ - 0, /* BNODE => nothing */ - 0, /* SNODE => nothing */ - 0, /* MNODE => nothing */ - 0, /* VNODE => nothing */ - 0, /* DATABASE => nothing */ - 0, /* USE => nothing */ - 0, /* FLUSH => nothing */ - 0, /* TRIM => nothing */ - 0, /* S3MIGRATE => nothing */ - 0, /* COMPACT => nothing */ - 0, /* IF => nothing */ - 0, /* NOT => nothing */ - 0, /* EXISTS => nothing */ - 0, /* BUFFER => nothing */ - 0, /* CACHEMODEL => nothing */ - 0, /* CACHESIZE => nothing */ - 0, /* COMP => nothing */ - 0, /* DURATION => nothing */ - 0, /* NK_VARIABLE => nothing */ - 0, /* MAXROWS => nothing */ - 0, /* MINROWS => nothing */ - 0, /* KEEP => nothing */ - 0, /* PAGES => nothing */ - 0, /* PAGESIZE => nothing */ - 0, /* TSDB_PAGESIZE => nothing */ - 0, /* PRECISION => nothing */ - 0, /* REPLICA => nothing */ - 0, /* VGROUPS => nothing */ - 0, /* SINGLE_STABLE => nothing */ - 0, /* RETENTIONS => nothing */ - 0, /* SCHEMALESS => nothing */ - 0, /* WAL_LEVEL => nothing */ - 0, /* WAL_FSYNC_PERIOD => nothing */ - 0, /* WAL_RETENTION_PERIOD => nothing */ - 0, /* WAL_RETENTION_SIZE => nothing */ - 0, /* WAL_ROLL_PERIOD => nothing */ - 0, /* WAL_SEGMENT_SIZE => nothing */ - 0, /* STT_TRIGGER => nothing */ - 0, /* TABLE_PREFIX => nothing */ - 0, /* TABLE_SUFFIX => nothing */ - 0, /* S3_CHUNKPAGES => nothing */ - 0, /* S3_KEEPLOCAL => nothing */ - 0, /* S3_COMPACT => nothing */ - 0, /* KEEP_TIME_OFFSET => nothing */ - 0, /* ENCRYPT_ALGORITHM => nothing */ - 0, /* NK_COLON => nothing */ - 0, /* BWLIMIT => nothing */ - 0, /* START => nothing */ - 0, /* TIMESTAMP => nothing */ - 344, /* END => ABORT */ - 0, /* TABLE => nothing */ - 0, /* NK_LP => nothing */ - 0, /* NK_RP => nothing */ - 0, /* USING => nothing */ - 344, /* FILE => ABORT */ - 0, /* STABLE => nothing */ - 0, /* COLUMN => nothing */ - 0, /* MODIFY => nothing */ - 0, /* RENAME => nothing */ - 0, /* TAG => nothing */ - 0, /* SET => nothing */ - 0, /* NK_EQ => nothing */ - 0, /* TAGS => nothing */ - 0, /* BOOL => nothing */ - 0, /* TINYINT => nothing */ - 0, /* SMALLINT => nothing */ - 0, /* INT => nothing */ - 0, /* INTEGER => nothing */ - 0, /* BIGINT => nothing */ - 0, /* FLOAT => nothing */ - 0, /* DOUBLE => nothing */ - 0, /* BINARY => nothing */ - 0, /* NCHAR => nothing */ - 0, /* UNSIGNED => nothing */ - 0, /* JSON => nothing */ - 0, /* VARCHAR => nothing */ - 0, /* MEDIUMBLOB => nothing */ - 0, /* BLOB => nothing */ - 0, /* VARBINARY => nothing */ - 0, /* GEOMETRY => nothing */ - 0, /* DECIMAL => nothing */ - 0, /* COMMENT => nothing */ - 0, /* MAX_DELAY => nothing */ - 0, /* WATERMARK => nothing */ - 0, /* ROLLUP => nothing */ - 0, /* TTL => nothing */ - 0, /* SMA => nothing */ - 0, /* DELETE_MARK => nothing */ - 0, /* FIRST => nothing */ - 0, /* LAST => nothing */ - 0, /* SHOW => nothing */ - 0, /* FULL => nothing */ - 0, /* PRIVILEGES => nothing */ - 0, /* DATABASES => nothing */ - 0, /* TABLES => nothing */ - 0, /* STABLES => nothing */ - 0, /* MNODES => nothing */ - 0, /* QNODES => nothing */ - 0, /* ARBGROUPS => nothing */ - 0, /* FUNCTIONS => nothing */ - 0, /* INDEXES => nothing */ - 0, /* ACCOUNTS => nothing */ - 0, /* APPS => nothing */ - 0, /* CONNECTIONS => nothing */ - 0, /* LICENCES => nothing */ - 0, /* GRANTS => nothing */ - 0, /* LOGS => nothing */ - 0, /* MACHINES => nothing */ - 0, /* ENCRYPTIONS => nothing */ - 0, /* QUERIES => nothing */ - 0, /* SCORES => nothing */ - 0, /* TOPICS => nothing */ - 0, /* VARIABLES => nothing */ - 0, /* BNODES => nothing */ - 0, /* SNODES => nothing */ - 0, /* TRANSACTIONS => nothing */ - 0, /* DISTRIBUTED => nothing */ - 0, /* CONSUMERS => nothing */ - 0, /* SUBSCRIPTIONS => nothing */ - 0, /* VNODES => nothing */ - 0, /* ALIVE => nothing */ - 0, /* VIEWS => nothing */ - 344, /* VIEW => ABORT */ - 0, /* COMPACTS => nothing */ - 0, /* NORMAL => nothing */ - 0, /* CHILD => nothing */ - 0, /* LIKE => nothing */ - 0, /* TBNAME => nothing */ - 0, /* QTAGS => nothing */ - 0, /* AS => nothing */ - 0, /* SYSTEM => nothing */ - 0, /* TSMA => nothing */ - 0, /* INTERVAL => nothing */ - 0, /* RECURSIVE => nothing */ - 0, /* TSMAS => nothing */ - 0, /* FUNCTION => nothing */ - 0, /* INDEX => nothing */ - 0, /* COUNT => nothing */ - 0, /* LAST_ROW => nothing */ - 0, /* META => nothing */ - 0, /* ONLY => nothing */ - 0, /* TOPIC => nothing */ - 0, /* CONSUMER => nothing */ - 0, /* GROUP => nothing */ - 0, /* DESC => nothing */ - 0, /* DESCRIBE => nothing */ - 0, /* RESET => nothing */ - 0, /* QUERY => nothing */ - 0, /* CACHE => nothing */ - 0, /* EXPLAIN => nothing */ - 0, /* ANALYZE => nothing */ - 0, /* VERBOSE => nothing */ - 0, /* NK_BOOL => nothing */ - 0, /* RATIO => nothing */ - 0, /* NK_FLOAT => nothing */ - 0, /* OUTPUTTYPE => nothing */ - 0, /* AGGREGATE => nothing */ - 0, /* BUFSIZE => nothing */ - 0, /* LANGUAGE => nothing */ - 0, /* REPLACE => nothing */ - 0, /* STREAM => nothing */ - 0, /* INTO => nothing */ - 0, /* PAUSE => nothing */ - 0, /* RESUME => nothing */ - 0, /* PRIMARY => nothing */ - 344, /* KEY => ABORT */ - 0, /* TRIGGER => nothing */ - 0, /* AT_ONCE => nothing */ - 0, /* WINDOW_CLOSE => nothing */ - 0, /* FORCE_WINDOW_CLOSE => nothing */ - 0, /* IGNORE => nothing */ - 0, /* EXPIRED => nothing */ - 0, /* FILL_HISTORY => nothing */ - 0, /* SUBTABLE => nothing */ - 0, /* UNTREATED => nothing */ - 0, /* KILL => nothing */ - 0, /* CONNECTION => nothing */ - 0, /* TRANSACTION => nothing */ - 0, /* BALANCE => nothing */ - 0, /* VGROUP => nothing */ - 0, /* LEADER => nothing */ - 0, /* MERGE => nothing */ - 0, /* REDISTRIBUTE => nothing */ - 0, /* SPLIT => nothing */ - 0, /* DELETE => nothing */ - 0, /* INSERT => nothing */ - 0, /* NK_BIN => nothing */ - 0, /* NK_HEX => nothing */ - 0, /* NULL => nothing */ - 0, /* NK_QUESTION => nothing */ - 0, /* NK_ALIAS => nothing */ - 0, /* NK_ARROW => nothing */ - 0, /* ROWTS => nothing */ - 0, /* QSTART => nothing */ - 0, /* QEND => nothing */ - 0, /* QDURATION => nothing */ - 0, /* WSTART => nothing */ - 0, /* WEND => nothing */ - 0, /* WDURATION => nothing */ - 0, /* IROWTS => nothing */ - 0, /* ISFILLED => nothing */ - 0, /* FLOW => nothing */ - 0, /* FHIGH => nothing */ - 0, /* FROWTS => nothing */ - 0, /* CAST => nothing */ - 0, /* POSITION => nothing */ - 0, /* IN => nothing */ - 344, /* FOR => ABORT */ - 0, /* NOW => nothing */ - 0, /* TODAY => nothing */ - 0, /* RAND => nothing */ - 0, /* SUBSTR => nothing */ - 0, /* SUBSTRING => nothing */ - 0, /* BOTH => nothing */ - 0, /* TRAILING => nothing */ - 0, /* LEADING => nothing */ - 0, /* TIMEZONE => nothing */ - 0, /* CLIENT_VERSION => nothing */ - 0, /* SERVER_VERSION => nothing */ - 0, /* SERVER_STATUS => nothing */ - 0, /* CURRENT_USER => nothing */ - 0, /* PI => nothing */ - 0, /* CASE => nothing */ - 0, /* WHEN => nothing */ - 0, /* THEN => nothing */ - 0, /* ELSE => nothing */ - 0, /* BETWEEN => nothing */ - 0, /* IS => nothing */ - 0, /* NK_LT => nothing */ - 0, /* NK_GT => nothing */ - 0, /* NK_LE => nothing */ - 0, /* NK_GE => nothing */ - 0, /* NK_NE => nothing */ - 0, /* MATCH => nothing */ - 0, /* NMATCH => nothing */ - 0, /* CONTAINS => nothing */ - 0, /* JOIN => nothing */ - 0, /* INNER => nothing */ - 0, /* LEFT => nothing */ - 0, /* RIGHT => nothing */ - 0, /* OUTER => nothing */ - 344, /* SEMI => ABORT */ - 0, /* ANTI => nothing */ - 0, /* ASOF => nothing */ - 0, /* WINDOW => nothing */ - 0, /* WINDOW_OFFSET => nothing */ - 0, /* JLIMIT => nothing */ - 0, /* SELECT => nothing */ - 0, /* NK_HINT => nothing */ - 0, /* DISTINCT => nothing */ - 0, /* WHERE => nothing */ - 0, /* PARTITION => nothing */ - 0, /* BY => nothing */ - 0, /* SESSION => nothing */ - 0, /* STATE_WINDOW => nothing */ - 0, /* EVENT_WINDOW => nothing */ - 0, /* COUNT_WINDOW => nothing */ - 0, /* ANOMALY_WINDOW => nothing */ - 0, /* SLIDING => nothing */ - 0, /* FILL => nothing */ - 0, /* VALUE => nothing */ - 0, /* VALUE_F => nothing */ - 0, /* NONE => nothing */ - 0, /* PREV => nothing */ - 0, /* NULL_F => nothing */ - 0, /* LINEAR => nothing */ - 0, /* NEXT => nothing */ - 0, /* HAVING => nothing */ - 0, /* RANGE => nothing */ - 0, /* EVERY => nothing */ - 0, /* ORDER => nothing */ - 0, /* SLIMIT => nothing */ - 0, /* SOFFSET => nothing */ - 0, /* LIMIT => nothing */ - 0, /* OFFSET => nothing */ - 0, /* ASC => nothing */ - 0, /* NULLS => nothing */ - 0, /* ABORT => nothing */ - 344, /* AFTER => ABORT */ - 344, /* ATTACH => ABORT */ - 344, /* BEFORE => ABORT */ - 344, /* BEGIN => ABORT */ - 344, /* BITAND => ABORT */ - 344, /* BITNOT => ABORT */ - 344, /* BITOR => ABORT */ - 344, /* BLOCKS => ABORT */ - 344, /* CHANGE => ABORT */ - 344, /* COMMA => ABORT */ - 344, /* CONCAT => ABORT */ - 344, /* CONFLICT => ABORT */ - 344, /* COPY => ABORT */ - 344, /* DEFERRED => ABORT */ - 344, /* DELIMITERS => ABORT */ - 344, /* DETACH => ABORT */ - 344, /* DIVIDE => ABORT */ - 344, /* DOT => ABORT */ - 344, /* EACH => ABORT */ - 344, /* FAIL => ABORT */ - 344, /* GLOB => ABORT */ - 344, /* ID => ABORT */ - 344, /* IMMEDIATE => ABORT */ - 344, /* IMPORT => ABORT */ - 344, /* INITIALLY => ABORT */ - 344, /* INSTEAD => ABORT */ - 344, /* ISNULL => ABORT */ - 344, /* MODULES => ABORT */ - 344, /* NK_BITNOT => ABORT */ - 344, /* NK_SEMI => ABORT */ - 344, /* NOTNULL => ABORT */ - 344, /* OF => ABORT */ - 344, /* PLUS => ABORT */ - 344, /* PRIVILEGE => ABORT */ - 344, /* RAISE => ABORT */ - 344, /* RESTRICT => ABORT */ - 344, /* ROW => ABORT */ - 344, /* STAR => ABORT */ - 344, /* STATEMENT => ABORT */ - 344, /* STRICT => ABORT */ - 344, /* STRING => ABORT */ - 344, /* TIMES => ABORT */ - 344, /* VALUES => ABORT */ - 344, /* VARIABLE => ABORT */ - 344, /* WAL => ABORT */ -}; -#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 - ParseARG_SDECL /* A place to hold %extra_argument */ - ParseCTX_SDECL /* A place to hold %extra_context */ -#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; - -#include -#ifndef NDEBUG -#include -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: -**
    -**
  • A FILE* to which trace output should be written. -** If NULL, then tracing is turned off. -**
  • A prefix string written at the beginning of every -** line of trace output. If NULL, then tracing is -** turned off. -**
-** -** Outputs: -** None. -*/ -void ParseTrace(FILE *TraceFILE, char *zTracePrompt){ - 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 */ "$", - /* 1 */ "OR", - /* 2 */ "AND", - /* 3 */ "UNION", - /* 4 */ "ALL", - /* 5 */ "MINUS", - /* 6 */ "EXCEPT", - /* 7 */ "INTERSECT", - /* 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", - /* 18 */ "CREATE", - /* 19 */ "ACCOUNT", - /* 20 */ "NK_ID", - /* 21 */ "PASS", - /* 22 */ "NK_STRING", - /* 23 */ "ALTER", - /* 24 */ "PPS", - /* 25 */ "TSERIES", - /* 26 */ "STORAGE", - /* 27 */ "STREAMS", - /* 28 */ "QTIME", - /* 29 */ "DBS", - /* 30 */ "USERS", - /* 31 */ "CONNS", - /* 32 */ "STATE", - /* 33 */ "NK_COMMA", - /* 34 */ "HOST", - /* 35 */ "IS_IMPORT", - /* 36 */ "NK_INTEGER", - /* 37 */ "CREATEDB", - /* 38 */ "USER", - /* 39 */ "ENABLE", - /* 40 */ "SYSINFO", - /* 41 */ "ADD", - /* 42 */ "DROP", - /* 43 */ "GRANT", - /* 44 */ "ON", - /* 45 */ "TO", - /* 46 */ "REVOKE", - /* 47 */ "FROM", - /* 48 */ "SUBSCRIBE", - /* 49 */ "READ", - /* 50 */ "WRITE", - /* 51 */ "NK_DOT", - /* 52 */ "WITH", - /* 53 */ "ENCRYPT_KEY", - /* 54 */ "ANODE", - /* 55 */ "UPDATE", - /* 56 */ "ANODES", - /* 57 */ "DNODE", - /* 58 */ "PORT", - /* 59 */ "DNODES", - /* 60 */ "RESTORE", - /* 61 */ "NK_IPTOKEN", - /* 62 */ "FORCE", - /* 63 */ "UNSAFE", - /* 64 */ "CLUSTER", - /* 65 */ "LOCAL", - /* 66 */ "QNODE", - /* 67 */ "BNODE", - /* 68 */ "SNODE", - /* 69 */ "MNODE", - /* 70 */ "VNODE", - /* 71 */ "DATABASE", - /* 72 */ "USE", - /* 73 */ "FLUSH", - /* 74 */ "TRIM", - /* 75 */ "S3MIGRATE", - /* 76 */ "COMPACT", - /* 77 */ "IF", - /* 78 */ "NOT", - /* 79 */ "EXISTS", - /* 80 */ "BUFFER", - /* 81 */ "CACHEMODEL", - /* 82 */ "CACHESIZE", - /* 83 */ "COMP", - /* 84 */ "DURATION", - /* 85 */ "NK_VARIABLE", - /* 86 */ "MAXROWS", - /* 87 */ "MINROWS", - /* 88 */ "KEEP", - /* 89 */ "PAGES", - /* 90 */ "PAGESIZE", - /* 91 */ "TSDB_PAGESIZE", - /* 92 */ "PRECISION", - /* 93 */ "REPLICA", - /* 94 */ "VGROUPS", - /* 95 */ "SINGLE_STABLE", - /* 96 */ "RETENTIONS", - /* 97 */ "SCHEMALESS", - /* 98 */ "WAL_LEVEL", - /* 99 */ "WAL_FSYNC_PERIOD", - /* 100 */ "WAL_RETENTION_PERIOD", - /* 101 */ "WAL_RETENTION_SIZE", - /* 102 */ "WAL_ROLL_PERIOD", - /* 103 */ "WAL_SEGMENT_SIZE", - /* 104 */ "STT_TRIGGER", - /* 105 */ "TABLE_PREFIX", - /* 106 */ "TABLE_SUFFIX", - /* 107 */ "S3_CHUNKPAGES", - /* 108 */ "S3_KEEPLOCAL", - /* 109 */ "S3_COMPACT", - /* 110 */ "KEEP_TIME_OFFSET", - /* 111 */ "ENCRYPT_ALGORITHM", - /* 112 */ "NK_COLON", - /* 113 */ "BWLIMIT", - /* 114 */ "START", - /* 115 */ "TIMESTAMP", - /* 116 */ "END", - /* 117 */ "TABLE", - /* 118 */ "NK_LP", - /* 119 */ "NK_RP", - /* 120 */ "USING", - /* 121 */ "FILE", - /* 122 */ "STABLE", - /* 123 */ "COLUMN", - /* 124 */ "MODIFY", - /* 125 */ "RENAME", - /* 126 */ "TAG", - /* 127 */ "SET", - /* 128 */ "NK_EQ", - /* 129 */ "TAGS", - /* 130 */ "BOOL", - /* 131 */ "TINYINT", - /* 132 */ "SMALLINT", - /* 133 */ "INT", - /* 134 */ "INTEGER", - /* 135 */ "BIGINT", - /* 136 */ "FLOAT", - /* 137 */ "DOUBLE", - /* 138 */ "BINARY", - /* 139 */ "NCHAR", - /* 140 */ "UNSIGNED", - /* 141 */ "JSON", - /* 142 */ "VARCHAR", - /* 143 */ "MEDIUMBLOB", - /* 144 */ "BLOB", - /* 145 */ "VARBINARY", - /* 146 */ "GEOMETRY", - /* 147 */ "DECIMAL", - /* 148 */ "COMMENT", - /* 149 */ "MAX_DELAY", - /* 150 */ "WATERMARK", - /* 151 */ "ROLLUP", - /* 152 */ "TTL", - /* 153 */ "SMA", - /* 154 */ "DELETE_MARK", - /* 155 */ "FIRST", - /* 156 */ "LAST", - /* 157 */ "SHOW", - /* 158 */ "FULL", - /* 159 */ "PRIVILEGES", - /* 160 */ "DATABASES", - /* 161 */ "TABLES", - /* 162 */ "STABLES", - /* 163 */ "MNODES", - /* 164 */ "QNODES", - /* 165 */ "ARBGROUPS", - /* 166 */ "FUNCTIONS", - /* 167 */ "INDEXES", - /* 168 */ "ACCOUNTS", - /* 169 */ "APPS", - /* 170 */ "CONNECTIONS", - /* 171 */ "LICENCES", - /* 172 */ "GRANTS", - /* 173 */ "LOGS", - /* 174 */ "MACHINES", - /* 175 */ "ENCRYPTIONS", - /* 176 */ "QUERIES", - /* 177 */ "SCORES", - /* 178 */ "TOPICS", - /* 179 */ "VARIABLES", - /* 180 */ "BNODES", - /* 181 */ "SNODES", - /* 182 */ "TRANSACTIONS", - /* 183 */ "DISTRIBUTED", - /* 184 */ "CONSUMERS", - /* 185 */ "SUBSCRIPTIONS", - /* 186 */ "VNODES", - /* 187 */ "ALIVE", - /* 188 */ "VIEWS", - /* 189 */ "VIEW", - /* 190 */ "COMPACTS", - /* 191 */ "NORMAL", - /* 192 */ "CHILD", - /* 193 */ "LIKE", - /* 194 */ "TBNAME", - /* 195 */ "QTAGS", - /* 196 */ "AS", - /* 197 */ "SYSTEM", - /* 198 */ "TSMA", - /* 199 */ "INTERVAL", - /* 200 */ "RECURSIVE", - /* 201 */ "TSMAS", - /* 202 */ "FUNCTION", - /* 203 */ "INDEX", - /* 204 */ "COUNT", - /* 205 */ "LAST_ROW", - /* 206 */ "META", - /* 207 */ "ONLY", - /* 208 */ "TOPIC", - /* 209 */ "CONSUMER", - /* 210 */ "GROUP", - /* 211 */ "DESC", - /* 212 */ "DESCRIBE", - /* 213 */ "RESET", - /* 214 */ "QUERY", - /* 215 */ "CACHE", - /* 216 */ "EXPLAIN", - /* 217 */ "ANALYZE", - /* 218 */ "VERBOSE", - /* 219 */ "NK_BOOL", - /* 220 */ "RATIO", - /* 221 */ "NK_FLOAT", - /* 222 */ "OUTPUTTYPE", - /* 223 */ "AGGREGATE", - /* 224 */ "BUFSIZE", - /* 225 */ "LANGUAGE", - /* 226 */ "REPLACE", - /* 227 */ "STREAM", - /* 228 */ "INTO", - /* 229 */ "PAUSE", - /* 230 */ "RESUME", - /* 231 */ "PRIMARY", - /* 232 */ "KEY", - /* 233 */ "TRIGGER", - /* 234 */ "AT_ONCE", - /* 235 */ "WINDOW_CLOSE", - /* 236 */ "FORCE_WINDOW_CLOSE", - /* 237 */ "IGNORE", - /* 238 */ "EXPIRED", - /* 239 */ "FILL_HISTORY", - /* 240 */ "SUBTABLE", - /* 241 */ "UNTREATED", - /* 242 */ "KILL", - /* 243 */ "CONNECTION", - /* 244 */ "TRANSACTION", - /* 245 */ "BALANCE", - /* 246 */ "VGROUP", - /* 247 */ "LEADER", - /* 248 */ "MERGE", - /* 249 */ "REDISTRIBUTE", - /* 250 */ "SPLIT", - /* 251 */ "DELETE", - /* 252 */ "INSERT", - /* 253 */ "NK_BIN", - /* 254 */ "NK_HEX", - /* 255 */ "NULL", - /* 256 */ "NK_QUESTION", - /* 257 */ "NK_ALIAS", - /* 258 */ "NK_ARROW", - /* 259 */ "ROWTS", - /* 260 */ "QSTART", - /* 261 */ "QEND", - /* 262 */ "QDURATION", - /* 263 */ "WSTART", - /* 264 */ "WEND", - /* 265 */ "WDURATION", - /* 266 */ "IROWTS", - /* 267 */ "ISFILLED", - /* 268 */ "FLOW", - /* 269 */ "FHIGH", - /* 270 */ "FROWTS", - /* 271 */ "CAST", - /* 272 */ "POSITION", - /* 273 */ "IN", - /* 274 */ "FOR", - /* 275 */ "NOW", - /* 276 */ "TODAY", - /* 277 */ "RAND", - /* 278 */ "SUBSTR", - /* 279 */ "SUBSTRING", - /* 280 */ "BOTH", - /* 281 */ "TRAILING", - /* 282 */ "LEADING", - /* 283 */ "TIMEZONE", - /* 284 */ "CLIENT_VERSION", - /* 285 */ "SERVER_VERSION", - /* 286 */ "SERVER_STATUS", - /* 287 */ "CURRENT_USER", - /* 288 */ "PI", - /* 289 */ "CASE", - /* 290 */ "WHEN", - /* 291 */ "THEN", - /* 292 */ "ELSE", - /* 293 */ "BETWEEN", - /* 294 */ "IS", - /* 295 */ "NK_LT", - /* 296 */ "NK_GT", - /* 297 */ "NK_LE", - /* 298 */ "NK_GE", - /* 299 */ "NK_NE", - /* 300 */ "MATCH", - /* 301 */ "NMATCH", - /* 302 */ "CONTAINS", - /* 303 */ "JOIN", - /* 304 */ "INNER", - /* 305 */ "LEFT", - /* 306 */ "RIGHT", - /* 307 */ "OUTER", - /* 308 */ "SEMI", - /* 309 */ "ANTI", - /* 310 */ "ASOF", - /* 311 */ "WINDOW", - /* 312 */ "WINDOW_OFFSET", - /* 313 */ "JLIMIT", - /* 314 */ "SELECT", - /* 315 */ "NK_HINT", - /* 316 */ "DISTINCT", - /* 317 */ "WHERE", - /* 318 */ "PARTITION", - /* 319 */ "BY", - /* 320 */ "SESSION", - /* 321 */ "STATE_WINDOW", - /* 322 */ "EVENT_WINDOW", - /* 323 */ "COUNT_WINDOW", - /* 324 */ "ANOMALY_WINDOW", - /* 325 */ "SLIDING", - /* 326 */ "FILL", - /* 327 */ "VALUE", - /* 328 */ "VALUE_F", - /* 329 */ "NONE", - /* 330 */ "PREV", - /* 331 */ "NULL_F", - /* 332 */ "LINEAR", - /* 333 */ "NEXT", - /* 334 */ "HAVING", - /* 335 */ "RANGE", - /* 336 */ "EVERY", - /* 337 */ "ORDER", - /* 338 */ "SLIMIT", - /* 339 */ "SOFFSET", - /* 340 */ "LIMIT", - /* 341 */ "OFFSET", - /* 342 */ "ASC", - /* 343 */ "NULLS", - /* 344 */ "ABORT", - /* 345 */ "AFTER", - /* 346 */ "ATTACH", - /* 347 */ "BEFORE", - /* 348 */ "BEGIN", - /* 349 */ "BITAND", - /* 350 */ "BITNOT", - /* 351 */ "BITOR", - /* 352 */ "BLOCKS", - /* 353 */ "CHANGE", - /* 354 */ "COMMA", - /* 355 */ "CONCAT", - /* 356 */ "CONFLICT", - /* 357 */ "COPY", - /* 358 */ "DEFERRED", - /* 359 */ "DELIMITERS", - /* 360 */ "DETACH", - /* 361 */ "DIVIDE", - /* 362 */ "DOT", - /* 363 */ "EACH", - /* 364 */ "FAIL", - /* 365 */ "GLOB", - /* 366 */ "ID", - /* 367 */ "IMMEDIATE", - /* 368 */ "IMPORT", - /* 369 */ "INITIALLY", - /* 370 */ "INSTEAD", - /* 371 */ "ISNULL", - /* 372 */ "MODULES", - /* 373 */ "NK_BITNOT", - /* 374 */ "NK_SEMI", - /* 375 */ "NOTNULL", - /* 376 */ "OF", - /* 377 */ "PLUS", - /* 378 */ "PRIVILEGE", - /* 379 */ "RAISE", - /* 380 */ "RESTRICT", - /* 381 */ "ROW", - /* 382 */ "STAR", - /* 383 */ "STATEMENT", - /* 384 */ "STRICT", - /* 385 */ "STRING", - /* 386 */ "TIMES", - /* 387 */ "VALUES", - /* 388 */ "VARIABLE", - /* 389 */ "WAL", - /* 390 */ "cmd", - /* 391 */ "account_options", - /* 392 */ "alter_account_options", - /* 393 */ "literal", - /* 394 */ "alter_account_option", - /* 395 */ "ip_range_list", - /* 396 */ "white_list", - /* 397 */ "white_list_opt", - /* 398 */ "is_import_opt", - /* 399 */ "is_createdb_opt", - /* 400 */ "user_name", - /* 401 */ "sysinfo_opt", - /* 402 */ "privileges", - /* 403 */ "priv_level", - /* 404 */ "with_clause_opt", - /* 405 */ "priv_type_list", - /* 406 */ "priv_type", - /* 407 */ "db_name", - /* 408 */ "table_name", - /* 409 */ "topic_name", - /* 410 */ "search_condition", - /* 411 */ "dnode_endpoint", - /* 412 */ "force_opt", - /* 413 */ "unsafe_opt", - /* 414 */ "not_exists_opt", - /* 415 */ "db_options", - /* 416 */ "exists_opt", - /* 417 */ "alter_db_options", - /* 418 */ "speed_opt", - /* 419 */ "start_opt", - /* 420 */ "end_opt", - /* 421 */ "integer_list", - /* 422 */ "variable_list", - /* 423 */ "retention_list", - /* 424 */ "signed", - /* 425 */ "alter_db_option", - /* 426 */ "retention", - /* 427 */ "full_table_name", - /* 428 */ "column_def_list", - /* 429 */ "tags_def_opt", - /* 430 */ "table_options", - /* 431 */ "multi_create_clause", - /* 432 */ "tag_list_opt", - /* 433 */ "tags_def", - /* 434 */ "with_opt", - /* 435 */ "multi_drop_clause", - /* 436 */ "alter_table_clause", - /* 437 */ "alter_table_options", - /* 438 */ "column_name", - /* 439 */ "type_name", - /* 440 */ "column_options", - /* 441 */ "tags_literal", - /* 442 */ "create_subtable_clause", - /* 443 */ "specific_cols_opt", - /* 444 */ "tags_literal_list", - /* 445 */ "drop_table_clause", - /* 446 */ "col_name_list", - /* 447 */ "tag_def_list", - /* 448 */ "tag_def", - /* 449 */ "column_def", - /* 450 */ "type_name_default_len", - /* 451 */ "duration_list", - /* 452 */ "rollup_func_list", - /* 453 */ "alter_table_option", - /* 454 */ "duration_literal", - /* 455 */ "rollup_func_name", - /* 456 */ "function_name", - /* 457 */ "col_name", - /* 458 */ "db_kind_opt", - /* 459 */ "table_kind_db_name_cond_opt", - /* 460 */ "like_pattern_opt", - /* 461 */ "db_name_cond_opt", - /* 462 */ "table_name_cond", - /* 463 */ "from_db_opt", - /* 464 */ "table_kind", - /* 465 */ "tag_item", - /* 466 */ "column_alias", - /* 467 */ "tsma_name", - /* 468 */ "tsma_func_list", - /* 469 */ "full_tsma_name", - /* 470 */ "func_list", - /* 471 */ "index_options", - /* 472 */ "full_index_name", - /* 473 */ "index_name", - /* 474 */ "sliding_opt", - /* 475 */ "sma_stream_opt", - /* 476 */ "func", - /* 477 */ "sma_func_name", - /* 478 */ "expression_list", - /* 479 */ "with_meta", - /* 480 */ "query_or_subquery", - /* 481 */ "where_clause_opt", - /* 482 */ "cgroup_name", - /* 483 */ "analyze_opt", - /* 484 */ "explain_options", - /* 485 */ "insert_query", - /* 486 */ "or_replace_opt", - /* 487 */ "agg_func_opt", - /* 488 */ "bufsize_opt", - /* 489 */ "language_opt", - /* 490 */ "full_view_name", - /* 491 */ "view_name", - /* 492 */ "stream_name", - /* 493 */ "stream_options", - /* 494 */ "col_list_opt", - /* 495 */ "tag_def_or_ref_opt", - /* 496 */ "subtable_opt", - /* 497 */ "ignore_opt", - /* 498 */ "column_stream_def_list", - /* 499 */ "column_stream_def", - /* 500 */ "stream_col_options", - /* 501 */ "expression", - /* 502 */ "on_vgroup_id", - /* 503 */ "dnode_list", - /* 504 */ "literal_func", - /* 505 */ "signed_literal", - /* 506 */ "literal_list", - /* 507 */ "table_alias", - /* 508 */ "expr_or_subquery", - /* 509 */ "pseudo_column", - /* 510 */ "column_reference", - /* 511 */ "function_expression", - /* 512 */ "case_when_expression", - /* 513 */ "star_func", - /* 514 */ "star_func_para_list", - /* 515 */ "trim_specification_type", - /* 516 */ "substr_func", - /* 517 */ "rand_func", - /* 518 */ "noarg_func", - /* 519 */ "other_para_list", - /* 520 */ "star_func_para", - /* 521 */ "when_then_list", - /* 522 */ "case_when_else_opt", - /* 523 */ "common_expression", - /* 524 */ "when_then_expr", - /* 525 */ "predicate", - /* 526 */ "compare_op", - /* 527 */ "in_op", - /* 528 */ "in_predicate_value", - /* 529 */ "boolean_value_expression", - /* 530 */ "boolean_primary", - /* 531 */ "from_clause_opt", - /* 532 */ "table_reference_list", - /* 533 */ "table_reference", - /* 534 */ "table_primary", - /* 535 */ "joined_table", - /* 536 */ "alias_opt", - /* 537 */ "subquery", - /* 538 */ "parenthesized_joined_table", - /* 539 */ "join_type", - /* 540 */ "join_subtype", - /* 541 */ "join_on_clause_opt", - /* 542 */ "window_offset_clause_opt", - /* 543 */ "jlimit_clause_opt", - /* 544 */ "window_offset_literal", - /* 545 */ "query_specification", - /* 546 */ "hint_list", - /* 547 */ "set_quantifier_opt", - /* 548 */ "tag_mode_opt", - /* 549 */ "select_list", - /* 550 */ "partition_by_clause_opt", - /* 551 */ "range_opt", - /* 552 */ "every_opt", - /* 553 */ "fill_opt", - /* 554 */ "twindow_clause_opt", - /* 555 */ "group_by_clause_opt", - /* 556 */ "having_clause_opt", - /* 557 */ "select_item", - /* 558 */ "partition_list", - /* 559 */ "partition_item", - /* 560 */ "interval_sliding_duration_literal", - /* 561 */ "fill_mode", - /* 562 */ "group_by_list", - /* 563 */ "query_expression", - /* 564 */ "query_simple", - /* 565 */ "order_by_clause_opt", - /* 566 */ "slimit_clause_opt", - /* 567 */ "limit_clause_opt", - /* 568 */ "union_query_expression", - /* 569 */ "query_simple_or_subquery", - /* 570 */ "sort_specification_list", - /* 571 */ "sort_specification", - /* 572 */ "ordering_specification_opt", - /* 573 */ "null_ordering_opt", -}; -#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ - -#ifndef NDEBUG -/* For tracing reduce actions, the names of all rules are required. -*/ -static const char *const yyRuleName[] = { - /* 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 */ "ip_range_list ::= NK_STRING", - /* 25 */ "ip_range_list ::= ip_range_list NK_COMMA NK_STRING", - /* 26 */ "white_list ::= HOST ip_range_list", - /* 27 */ "white_list_opt ::=", - /* 28 */ "white_list_opt ::= white_list", - /* 29 */ "is_import_opt ::=", - /* 30 */ "is_import_opt ::= IS_IMPORT NK_INTEGER", - /* 31 */ "is_createdb_opt ::=", - /* 32 */ "is_createdb_opt ::= CREATEDB NK_INTEGER", - /* 33 */ "cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt", - /* 34 */ "cmd ::= ALTER USER user_name PASS NK_STRING", - /* 35 */ "cmd ::= ALTER USER user_name ENABLE NK_INTEGER", - /* 36 */ "cmd ::= ALTER USER user_name SYSINFO NK_INTEGER", - /* 37 */ "cmd ::= ALTER USER user_name CREATEDB NK_INTEGER", - /* 38 */ "cmd ::= ALTER USER user_name ADD white_list", - /* 39 */ "cmd ::= ALTER USER user_name DROP white_list", - /* 40 */ "cmd ::= DROP USER user_name", - /* 41 */ "sysinfo_opt ::=", - /* 42 */ "sysinfo_opt ::= SYSINFO NK_INTEGER", - /* 43 */ "cmd ::= GRANT privileges ON priv_level with_clause_opt TO user_name", - /* 44 */ "cmd ::= REVOKE privileges ON priv_level with_clause_opt FROM user_name", - /* 45 */ "privileges ::= ALL", - /* 46 */ "privileges ::= priv_type_list", - /* 47 */ "privileges ::= SUBSCRIBE", - /* 48 */ "priv_type_list ::= priv_type", - /* 49 */ "priv_type_list ::= priv_type_list NK_COMMA priv_type", - /* 50 */ "priv_type ::= READ", - /* 51 */ "priv_type ::= WRITE", - /* 52 */ "priv_type ::= ALTER", - /* 53 */ "priv_level ::= NK_STAR NK_DOT NK_STAR", - /* 54 */ "priv_level ::= db_name NK_DOT NK_STAR", - /* 55 */ "priv_level ::= db_name NK_DOT table_name", - /* 56 */ "priv_level ::= topic_name", - /* 57 */ "with_clause_opt ::=", - /* 58 */ "with_clause_opt ::= WITH search_condition", - /* 59 */ "cmd ::= CREATE ENCRYPT_KEY NK_STRING", - /* 60 */ "cmd ::= CREATE ANODE NK_STRING", - /* 61 */ "cmd ::= UPDATE ANODE NK_INTEGER", - /* 62 */ "cmd ::= UPDATE ALL ANODES", - /* 63 */ "cmd ::= DROP ANODE NK_INTEGER", - /* 64 */ "cmd ::= CREATE DNODE dnode_endpoint", - /* 65 */ "cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER", - /* 66 */ "cmd ::= DROP DNODE NK_INTEGER force_opt", - /* 67 */ "cmd ::= DROP DNODE dnode_endpoint force_opt", - /* 68 */ "cmd ::= DROP DNODE NK_INTEGER unsafe_opt", - /* 69 */ "cmd ::= DROP DNODE dnode_endpoint unsafe_opt", - /* 70 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING", - /* 71 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING", - /* 72 */ "cmd ::= ALTER ALL DNODES NK_STRING", - /* 73 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING", - /* 74 */ "cmd ::= RESTORE DNODE NK_INTEGER", - /* 75 */ "dnode_endpoint ::= NK_STRING", - /* 76 */ "dnode_endpoint ::= NK_ID", - /* 77 */ "dnode_endpoint ::= NK_IPTOKEN", - /* 78 */ "force_opt ::=", - /* 79 */ "force_opt ::= FORCE", - /* 80 */ "unsafe_opt ::= UNSAFE", - /* 81 */ "cmd ::= ALTER CLUSTER NK_STRING", - /* 82 */ "cmd ::= ALTER CLUSTER NK_STRING NK_STRING", - /* 83 */ "cmd ::= ALTER LOCAL NK_STRING", - /* 84 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING", - /* 85 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER", - /* 86 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER", - /* 87 */ "cmd ::= RESTORE QNODE ON DNODE NK_INTEGER", - /* 88 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER", - /* 89 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER", - /* 90 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER", - /* 91 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER", - /* 92 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER", - /* 93 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER", - /* 94 */ "cmd ::= RESTORE MNODE ON DNODE NK_INTEGER", - /* 95 */ "cmd ::= RESTORE VNODE ON DNODE NK_INTEGER", - /* 96 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options", - /* 97 */ "cmd ::= DROP DATABASE exists_opt db_name", - /* 98 */ "cmd ::= USE db_name", - /* 99 */ "cmd ::= ALTER DATABASE db_name alter_db_options", - /* 100 */ "cmd ::= FLUSH DATABASE db_name", - /* 101 */ "cmd ::= TRIM DATABASE db_name speed_opt", - /* 102 */ "cmd ::= S3MIGRATE DATABASE db_name", - /* 103 */ "cmd ::= COMPACT DATABASE db_name start_opt end_opt", - /* 104 */ "not_exists_opt ::= IF NOT EXISTS", - /* 105 */ "not_exists_opt ::=", - /* 106 */ "exists_opt ::= IF EXISTS", - /* 107 */ "exists_opt ::=", - /* 108 */ "db_options ::=", - /* 109 */ "db_options ::= db_options BUFFER NK_INTEGER", - /* 110 */ "db_options ::= db_options CACHEMODEL NK_STRING", - /* 111 */ "db_options ::= db_options CACHESIZE NK_INTEGER", - /* 112 */ "db_options ::= db_options COMP NK_INTEGER", - /* 113 */ "db_options ::= db_options DURATION NK_INTEGER", - /* 114 */ "db_options ::= db_options DURATION NK_VARIABLE", - /* 115 */ "db_options ::= db_options MAXROWS NK_INTEGER", - /* 116 */ "db_options ::= db_options MINROWS NK_INTEGER", - /* 117 */ "db_options ::= db_options KEEP integer_list", - /* 118 */ "db_options ::= db_options KEEP variable_list", - /* 119 */ "db_options ::= db_options PAGES NK_INTEGER", - /* 120 */ "db_options ::= db_options PAGESIZE NK_INTEGER", - /* 121 */ "db_options ::= db_options TSDB_PAGESIZE NK_INTEGER", - /* 122 */ "db_options ::= db_options PRECISION NK_STRING", - /* 123 */ "db_options ::= db_options REPLICA NK_INTEGER", - /* 124 */ "db_options ::= db_options VGROUPS NK_INTEGER", - /* 125 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", - /* 126 */ "db_options ::= db_options RETENTIONS retention_list", - /* 127 */ "db_options ::= db_options SCHEMALESS NK_INTEGER", - /* 128 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER", - /* 129 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER", - /* 130 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER", - /* 131 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", - /* 132 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER", - /* 133 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", - /* 134 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER", - /* 135 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER", - /* 136 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER", - /* 137 */ "db_options ::= db_options TABLE_PREFIX signed", - /* 138 */ "db_options ::= db_options TABLE_SUFFIX signed", - /* 139 */ "db_options ::= db_options S3_CHUNKPAGES NK_INTEGER", - /* 140 */ "db_options ::= db_options S3_KEEPLOCAL NK_INTEGER", - /* 141 */ "db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE", - /* 142 */ "db_options ::= db_options S3_COMPACT NK_INTEGER", - /* 143 */ "db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER", - /* 144 */ "db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING", - /* 145 */ "db_options ::= db_options DNODES NK_STRING", - /* 146 */ "alter_db_options ::= alter_db_option", - /* 147 */ "alter_db_options ::= alter_db_options alter_db_option", - /* 148 */ "alter_db_option ::= BUFFER NK_INTEGER", - /* 149 */ "alter_db_option ::= CACHEMODEL NK_STRING", - /* 150 */ "alter_db_option ::= CACHESIZE NK_INTEGER", - /* 151 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", - /* 152 */ "alter_db_option ::= KEEP integer_list", - /* 153 */ "alter_db_option ::= KEEP variable_list", - /* 154 */ "alter_db_option ::= PAGES NK_INTEGER", - /* 155 */ "alter_db_option ::= REPLICA NK_INTEGER", - /* 156 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", - /* 157 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", - /* 158 */ "alter_db_option ::= MINROWS NK_INTEGER", - /* 159 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER", - /* 160 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", - /* 161 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER", - /* 162 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", - /* 163 */ "alter_db_option ::= S3_KEEPLOCAL NK_INTEGER", - /* 164 */ "alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE", - /* 165 */ "alter_db_option ::= S3_COMPACT NK_INTEGER", - /* 166 */ "alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER", - /* 167 */ "alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING", - /* 168 */ "integer_list ::= NK_INTEGER", - /* 169 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", - /* 170 */ "variable_list ::= NK_VARIABLE", - /* 171 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", - /* 172 */ "retention_list ::= retention", - /* 173 */ "retention_list ::= retention_list NK_COMMA retention", - /* 174 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", - /* 175 */ "retention ::= NK_MINUS NK_COLON NK_VARIABLE", - /* 176 */ "speed_opt ::=", - /* 177 */ "speed_opt ::= BWLIMIT NK_INTEGER", - /* 178 */ "start_opt ::=", - /* 179 */ "start_opt ::= START WITH NK_INTEGER", - /* 180 */ "start_opt ::= START WITH NK_STRING", - /* 181 */ "start_opt ::= START WITH TIMESTAMP NK_STRING", - /* 182 */ "end_opt ::=", - /* 183 */ "end_opt ::= END WITH NK_INTEGER", - /* 184 */ "end_opt ::= END WITH NK_STRING", - /* 185 */ "end_opt ::= END WITH TIMESTAMP NK_STRING", - /* 186 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", - /* 187 */ "cmd ::= CREATE TABLE multi_create_clause", - /* 188 */ "cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING", - /* 189 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 190 */ "cmd ::= DROP TABLE with_opt multi_drop_clause", - /* 191 */ "cmd ::= DROP STABLE with_opt exists_opt full_table_name", - /* 192 */ "cmd ::= ALTER TABLE alter_table_clause", - /* 193 */ "cmd ::= ALTER STABLE alter_table_clause", - /* 194 */ "alter_table_clause ::= full_table_name alter_table_options", - /* 195 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options", - /* 196 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", - /* 197 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", - /* 198 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options", - /* 199 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", - /* 200 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", - /* 201 */ "alter_table_clause ::= full_table_name DROP TAG column_name", - /* 202 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", - /* 203 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", - /* 204 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal", - /* 205 */ "multi_create_clause ::= create_subtable_clause", - /* 206 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 207 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options", - /* 208 */ "multi_drop_clause ::= drop_table_clause", - /* 209 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause", - /* 210 */ "drop_table_clause ::= exists_opt full_table_name", - /* 211 */ "with_opt ::=", - /* 212 */ "with_opt ::= WITH", - /* 213 */ "specific_cols_opt ::=", - /* 214 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", - /* 215 */ "full_table_name ::= table_name", - /* 216 */ "full_table_name ::= db_name NK_DOT table_name", - /* 217 */ "tag_def_list ::= tag_def", - /* 218 */ "tag_def_list ::= tag_def_list NK_COMMA tag_def", - /* 219 */ "tag_def ::= column_name type_name", - /* 220 */ "column_def_list ::= column_def", - /* 221 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 222 */ "column_def ::= column_name type_name column_options", - /* 223 */ "type_name ::= BOOL", - /* 224 */ "type_name ::= TINYINT", - /* 225 */ "type_name ::= SMALLINT", - /* 226 */ "type_name ::= INT", - /* 227 */ "type_name ::= INTEGER", - /* 228 */ "type_name ::= BIGINT", - /* 229 */ "type_name ::= FLOAT", - /* 230 */ "type_name ::= DOUBLE", - /* 231 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 232 */ "type_name ::= TIMESTAMP", - /* 233 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 234 */ "type_name ::= TINYINT UNSIGNED", - /* 235 */ "type_name ::= SMALLINT UNSIGNED", - /* 236 */ "type_name ::= INT UNSIGNED", - /* 237 */ "type_name ::= BIGINT UNSIGNED", - /* 238 */ "type_name ::= JSON", - /* 239 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 240 */ "type_name ::= MEDIUMBLOB", - /* 241 */ "type_name ::= BLOB", - /* 242 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 243 */ "type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP", - /* 244 */ "type_name ::= DECIMAL", - /* 245 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 246 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 247 */ "type_name_default_len ::= BINARY", - /* 248 */ "type_name_default_len ::= NCHAR", - /* 249 */ "type_name_default_len ::= VARCHAR", - /* 250 */ "type_name_default_len ::= VARBINARY", - /* 251 */ "tags_def_opt ::=", - /* 252 */ "tags_def_opt ::= tags_def", - /* 253 */ "tags_def ::= TAGS NK_LP tag_def_list NK_RP", - /* 254 */ "table_options ::=", - /* 255 */ "table_options ::= table_options COMMENT NK_STRING", - /* 256 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 257 */ "table_options ::= table_options WATERMARK duration_list", - /* 258 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 259 */ "table_options ::= table_options TTL NK_INTEGER", - /* 260 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 261 */ "table_options ::= table_options DELETE_MARK duration_list", - /* 262 */ "alter_table_options ::= alter_table_option", - /* 263 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 264 */ "alter_table_option ::= COMMENT NK_STRING", - /* 265 */ "alter_table_option ::= TTL NK_INTEGER", - /* 266 */ "duration_list ::= duration_literal", - /* 267 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 268 */ "rollup_func_list ::= rollup_func_name", - /* 269 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 270 */ "rollup_func_name ::= function_name", - /* 271 */ "rollup_func_name ::= FIRST", - /* 272 */ "rollup_func_name ::= LAST", - /* 273 */ "col_name_list ::= col_name", - /* 274 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 275 */ "col_name ::= column_name", - /* 276 */ "cmd ::= SHOW DNODES", - /* 277 */ "cmd ::= SHOW USERS", - /* 278 */ "cmd ::= SHOW USERS FULL", - /* 279 */ "cmd ::= SHOW USER PRIVILEGES", - /* 280 */ "cmd ::= SHOW db_kind_opt DATABASES", - /* 281 */ "cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt", - /* 282 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 283 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 284 */ "cmd ::= SHOW MNODES", - /* 285 */ "cmd ::= SHOW QNODES", - /* 286 */ "cmd ::= SHOW ANODES", - /* 287 */ "cmd ::= SHOW ANODES FULL", - /* 288 */ "cmd ::= SHOW ARBGROUPS", - /* 289 */ "cmd ::= SHOW FUNCTIONS", - /* 290 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 291 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", - /* 292 */ "cmd ::= SHOW STREAMS", - /* 293 */ "cmd ::= SHOW ACCOUNTS", - /* 294 */ "cmd ::= SHOW APPS", - /* 295 */ "cmd ::= SHOW CONNECTIONS", - /* 296 */ "cmd ::= SHOW LICENCES", - /* 297 */ "cmd ::= SHOW GRANTS", - /* 298 */ "cmd ::= SHOW GRANTS FULL", - /* 299 */ "cmd ::= SHOW GRANTS LOGS", - /* 300 */ "cmd ::= SHOW CLUSTER MACHINES", - /* 301 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 302 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 303 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 304 */ "cmd ::= SHOW ENCRYPTIONS", - /* 305 */ "cmd ::= SHOW QUERIES", - /* 306 */ "cmd ::= SHOW SCORES", - /* 307 */ "cmd ::= SHOW TOPICS", - /* 308 */ "cmd ::= SHOW VARIABLES", - /* 309 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 310 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 311 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 312 */ "cmd ::= SHOW BNODES", - /* 313 */ "cmd ::= SHOW SNODES", - /* 314 */ "cmd ::= SHOW CLUSTER", - /* 315 */ "cmd ::= SHOW TRANSACTIONS", - /* 316 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 317 */ "cmd ::= SHOW CONSUMERS", - /* 318 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 319 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 320 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", - /* 321 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 322 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", - /* 323 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", - /* 324 */ "cmd ::= SHOW VNODES", - /* 325 */ "cmd ::= SHOW db_name_cond_opt ALIVE", - /* 326 */ "cmd ::= SHOW CLUSTER ALIVE", - /* 327 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt", - /* 328 */ "cmd ::= SHOW CREATE VIEW full_table_name", - /* 329 */ "cmd ::= SHOW COMPACTS", - /* 330 */ "cmd ::= SHOW COMPACT NK_INTEGER", - /* 331 */ "table_kind_db_name_cond_opt ::=", - /* 332 */ "table_kind_db_name_cond_opt ::= table_kind", - /* 333 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", - /* 334 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", - /* 335 */ "table_kind ::= NORMAL", - /* 336 */ "table_kind ::= CHILD", - /* 337 */ "db_name_cond_opt ::=", - /* 338 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 339 */ "like_pattern_opt ::=", - /* 340 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 341 */ "table_name_cond ::= table_name", - /* 342 */ "from_db_opt ::=", - /* 343 */ "from_db_opt ::= FROM db_name", - /* 344 */ "tag_list_opt ::=", - /* 345 */ "tag_list_opt ::= tag_item", - /* 346 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 347 */ "tag_item ::= TBNAME", - /* 348 */ "tag_item ::= QTAGS", - /* 349 */ "tag_item ::= column_name", - /* 350 */ "tag_item ::= column_name column_alias", - /* 351 */ "tag_item ::= column_name AS column_alias", - /* 352 */ "db_kind_opt ::=", - /* 353 */ "db_kind_opt ::= USER", - /* 354 */ "db_kind_opt ::= SYSTEM", - /* 355 */ "cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP", - /* 356 */ "cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP", - /* 357 */ "cmd ::= DROP TSMA exists_opt full_tsma_name", - /* 358 */ "cmd ::= SHOW db_name_cond_opt TSMAS", - /* 359 */ "full_tsma_name ::= tsma_name", - /* 360 */ "full_tsma_name ::= db_name NK_DOT tsma_name", - /* 361 */ "tsma_func_list ::= FUNCTION NK_LP func_list NK_RP", - /* 362 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", - /* 363 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", - /* 364 */ "cmd ::= DROP INDEX exists_opt full_index_name", - /* 365 */ "full_index_name ::= index_name", - /* 366 */ "full_index_name ::= db_name NK_DOT index_name", - /* 367 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 368 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", - /* 369 */ "func_list ::= func", - /* 370 */ "func_list ::= func_list NK_COMMA func", - /* 371 */ "func ::= sma_func_name NK_LP expression_list NK_RP", - /* 372 */ "sma_func_name ::= function_name", - /* 373 */ "sma_func_name ::= COUNT", - /* 374 */ "sma_func_name ::= FIRST", - /* 375 */ "sma_func_name ::= LAST", - /* 376 */ "sma_func_name ::= LAST_ROW", - /* 377 */ "sma_stream_opt ::=", - /* 378 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 379 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 380 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 381 */ "with_meta ::= AS", - /* 382 */ "with_meta ::= WITH META AS", - /* 383 */ "with_meta ::= ONLY META AS", - /* 384 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 385 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", - /* 386 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", - /* 387 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 388 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 389 */ "cmd ::= DESC full_table_name", - /* 390 */ "cmd ::= DESCRIBE full_table_name", - /* 391 */ "cmd ::= RESET QUERY CACHE", - /* 392 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 393 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", - /* 394 */ "analyze_opt ::=", - /* 395 */ "analyze_opt ::= ANALYZE", - /* 396 */ "explain_options ::=", - /* 397 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 398 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 399 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", - /* 400 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 401 */ "agg_func_opt ::=", - /* 402 */ "agg_func_opt ::= AGGREGATE", - /* 403 */ "bufsize_opt ::=", - /* 404 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 405 */ "language_opt ::=", - /* 406 */ "language_opt ::= LANGUAGE NK_STRING", - /* 407 */ "or_replace_opt ::=", - /* 408 */ "or_replace_opt ::= OR REPLACE", - /* 409 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", - /* 410 */ "cmd ::= DROP VIEW exists_opt full_view_name", - /* 411 */ "full_view_name ::= view_name", - /* 412 */ "full_view_name ::= db_name NK_DOT view_name", - /* 413 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery", - /* 414 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 415 */ "cmd ::= PAUSE STREAM exists_opt stream_name", - /* 416 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", - /* 417 */ "col_list_opt ::=", - /* 418 */ "col_list_opt ::= NK_LP column_stream_def_list NK_RP", - /* 419 */ "column_stream_def_list ::= column_stream_def", - /* 420 */ "column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def", - /* 421 */ "column_stream_def ::= column_name stream_col_options", - /* 422 */ "stream_col_options ::=", - /* 423 */ "stream_col_options ::= stream_col_options PRIMARY KEY", - /* 424 */ "tag_def_or_ref_opt ::=", - /* 425 */ "tag_def_or_ref_opt ::= tags_def", - /* 426 */ "tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP", - /* 427 */ "stream_options ::=", - /* 428 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 429 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 430 */ "stream_options ::= stream_options TRIGGER FORCE_WINDOW_CLOSE", - /* 431 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 432 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 433 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 434 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 435 */ "stream_options ::= stream_options DELETE_MARK duration_literal", - /* 436 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", - /* 437 */ "subtable_opt ::=", - /* 438 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 439 */ "ignore_opt ::=", - /* 440 */ "ignore_opt ::= IGNORE UNTREATED", - /* 441 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 442 */ "cmd ::= KILL QUERY NK_STRING", - /* 443 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 444 */ "cmd ::= KILL COMPACT NK_INTEGER", - /* 445 */ "cmd ::= BALANCE VGROUP", - /* 446 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", - /* 447 */ "cmd ::= BALANCE VGROUP LEADER DATABASE db_name", - /* 448 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 449 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 450 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 451 */ "on_vgroup_id ::=", - /* 452 */ "on_vgroup_id ::= ON NK_INTEGER", - /* 453 */ "dnode_list ::= DNODE NK_INTEGER", - /* 454 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 455 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 456 */ "cmd ::= query_or_subquery", - /* 457 */ "cmd ::= insert_query", - /* 458 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 459 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", - /* 460 */ "tags_literal ::= NK_INTEGER", - /* 461 */ "tags_literal ::= NK_INTEGER NK_PLUS duration_literal", - /* 462 */ "tags_literal ::= NK_INTEGER NK_MINUS duration_literal", - /* 463 */ "tags_literal ::= NK_PLUS NK_INTEGER", - /* 464 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal", - /* 465 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal", - /* 466 */ "tags_literal ::= NK_MINUS NK_INTEGER", - /* 467 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal", - /* 468 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal", - /* 469 */ "tags_literal ::= NK_FLOAT", - /* 470 */ "tags_literal ::= NK_PLUS NK_FLOAT", - /* 471 */ "tags_literal ::= NK_MINUS NK_FLOAT", - /* 472 */ "tags_literal ::= NK_BIN", - /* 473 */ "tags_literal ::= NK_BIN NK_PLUS duration_literal", - /* 474 */ "tags_literal ::= NK_BIN NK_MINUS duration_literal", - /* 475 */ "tags_literal ::= NK_PLUS NK_BIN", - /* 476 */ "tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal", - /* 477 */ "tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal", - /* 478 */ "tags_literal ::= NK_MINUS NK_BIN", - /* 479 */ "tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal", - /* 480 */ "tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal", - /* 481 */ "tags_literal ::= NK_HEX", - /* 482 */ "tags_literal ::= NK_HEX NK_PLUS duration_literal", - /* 483 */ "tags_literal ::= NK_HEX NK_MINUS duration_literal", - /* 484 */ "tags_literal ::= NK_PLUS NK_HEX", - /* 485 */ "tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal", - /* 486 */ "tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal", - /* 487 */ "tags_literal ::= NK_MINUS NK_HEX", - /* 488 */ "tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal", - /* 489 */ "tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal", - /* 490 */ "tags_literal ::= NK_STRING", - /* 491 */ "tags_literal ::= NK_STRING NK_PLUS duration_literal", - /* 492 */ "tags_literal ::= NK_STRING NK_MINUS duration_literal", - /* 493 */ "tags_literal ::= NK_BOOL", - /* 494 */ "tags_literal ::= NULL", - /* 495 */ "tags_literal ::= literal_func", - /* 496 */ "tags_literal ::= literal_func NK_PLUS duration_literal", - /* 497 */ "tags_literal ::= literal_func NK_MINUS duration_literal", - /* 498 */ "tags_literal_list ::= tags_literal", - /* 499 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal", - /* 500 */ "literal ::= NK_INTEGER", - /* 501 */ "literal ::= NK_FLOAT", - /* 502 */ "literal ::= NK_STRING", - /* 503 */ "literal ::= NK_BOOL", - /* 504 */ "literal ::= TIMESTAMP NK_STRING", - /* 505 */ "literal ::= duration_literal", - /* 506 */ "literal ::= NULL", - /* 507 */ "literal ::= NK_QUESTION", - /* 508 */ "duration_literal ::= NK_VARIABLE", - /* 509 */ "signed ::= NK_INTEGER", - /* 510 */ "signed ::= NK_PLUS NK_INTEGER", - /* 511 */ "signed ::= NK_MINUS NK_INTEGER", - /* 512 */ "signed ::= NK_FLOAT", - /* 513 */ "signed ::= NK_PLUS NK_FLOAT", - /* 514 */ "signed ::= NK_MINUS NK_FLOAT", - /* 515 */ "signed_literal ::= signed", - /* 516 */ "signed_literal ::= NK_STRING", - /* 517 */ "signed_literal ::= NK_BOOL", - /* 518 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 519 */ "signed_literal ::= duration_literal", - /* 520 */ "signed_literal ::= NULL", - /* 521 */ "signed_literal ::= literal_func", - /* 522 */ "signed_literal ::= NK_QUESTION", - /* 523 */ "literal_list ::= signed_literal", - /* 524 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 525 */ "db_name ::= NK_ID", - /* 526 */ "table_name ::= NK_ID", - /* 527 */ "column_name ::= NK_ID", - /* 528 */ "function_name ::= NK_ID", - /* 529 */ "view_name ::= NK_ID", - /* 530 */ "table_alias ::= NK_ID", - /* 531 */ "column_alias ::= NK_ID", - /* 532 */ "column_alias ::= NK_ALIAS", - /* 533 */ "user_name ::= NK_ID", - /* 534 */ "topic_name ::= NK_ID", - /* 535 */ "stream_name ::= NK_ID", - /* 536 */ "cgroup_name ::= NK_ID", - /* 537 */ "index_name ::= NK_ID", - /* 538 */ "tsma_name ::= NK_ID", - /* 539 */ "expr_or_subquery ::= expression", - /* 540 */ "expression ::= literal", - /* 541 */ "expression ::= pseudo_column", - /* 542 */ "expression ::= column_reference", - /* 543 */ "expression ::= function_expression", - /* 544 */ "expression ::= case_when_expression", - /* 545 */ "expression ::= NK_LP expression NK_RP", - /* 546 */ "expression ::= NK_PLUS expr_or_subquery", - /* 547 */ "expression ::= NK_MINUS expr_or_subquery", - /* 548 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 549 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 550 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 551 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 552 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 553 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 554 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 555 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 556 */ "expression_list ::= expr_or_subquery", - /* 557 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 558 */ "column_reference ::= column_name", - /* 559 */ "column_reference ::= table_name NK_DOT column_name", - /* 560 */ "column_reference ::= NK_ALIAS", - /* 561 */ "column_reference ::= table_name NK_DOT NK_ALIAS", - /* 562 */ "pseudo_column ::= ROWTS", - /* 563 */ "pseudo_column ::= TBNAME", - /* 564 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 565 */ "pseudo_column ::= QSTART", - /* 566 */ "pseudo_column ::= QEND", - /* 567 */ "pseudo_column ::= QDURATION", - /* 568 */ "pseudo_column ::= WSTART", - /* 569 */ "pseudo_column ::= WEND", - /* 570 */ "pseudo_column ::= WDURATION", - /* 571 */ "pseudo_column ::= IROWTS", - /* 572 */ "pseudo_column ::= ISFILLED", - /* 573 */ "pseudo_column ::= QTAGS", - /* 574 */ "pseudo_column ::= FLOW", - /* 575 */ "pseudo_column ::= FHIGH", - /* 576 */ "pseudo_column ::= FROWTS", - /* 577 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 578 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 579 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 580 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP", - /* 581 */ "function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP", - /* 582 */ "function_expression ::= TRIM NK_LP expr_or_subquery NK_RP", - /* 583 */ "function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP", - /* 584 */ "function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP", - /* 585 */ "function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP", - /* 586 */ "function_expression ::= substr_func NK_LP expression_list NK_RP", - /* 587 */ "function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP", - /* 588 */ "function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP", - /* 589 */ "function_expression ::= REPLACE NK_LP expression_list NK_RP", - /* 590 */ "function_expression ::= literal_func", - /* 591 */ "function_expression ::= rand_func", - /* 592 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 593 */ "literal_func ::= NOW", - /* 594 */ "literal_func ::= TODAY", - /* 595 */ "rand_func ::= RAND NK_LP NK_RP", - /* 596 */ "rand_func ::= RAND NK_LP expression_list NK_RP", - /* 597 */ "substr_func ::= SUBSTR", - /* 598 */ "substr_func ::= SUBSTRING", - /* 599 */ "trim_specification_type ::= BOTH", - /* 600 */ "trim_specification_type ::= TRAILING", - /* 601 */ "trim_specification_type ::= LEADING", - /* 602 */ "noarg_func ::= NOW", - /* 603 */ "noarg_func ::= TODAY", - /* 604 */ "noarg_func ::= TIMEZONE", - /* 605 */ "noarg_func ::= DATABASE", - /* 606 */ "noarg_func ::= CLIENT_VERSION", - /* 607 */ "noarg_func ::= SERVER_VERSION", - /* 608 */ "noarg_func ::= SERVER_STATUS", - /* 609 */ "noarg_func ::= CURRENT_USER", - /* 610 */ "noarg_func ::= USER", - /* 611 */ "noarg_func ::= PI", - /* 612 */ "star_func ::= COUNT", - /* 613 */ "star_func ::= FIRST", - /* 614 */ "star_func ::= LAST", - /* 615 */ "star_func ::= LAST_ROW", - /* 616 */ "star_func_para_list ::= NK_STAR", - /* 617 */ "star_func_para_list ::= other_para_list", - /* 618 */ "other_para_list ::= star_func_para", - /* 619 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 620 */ "star_func_para ::= expr_or_subquery", - /* 621 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 622 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 623 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 624 */ "when_then_list ::= when_then_expr", - /* 625 */ "when_then_list ::= when_then_list when_then_expr", - /* 626 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 627 */ "case_when_else_opt ::=", - /* 628 */ "case_when_else_opt ::= ELSE common_expression", - /* 629 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 630 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 631 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 632 */ "predicate ::= expr_or_subquery IS NULL", - /* 633 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 634 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 635 */ "compare_op ::= NK_LT", - /* 636 */ "compare_op ::= NK_GT", - /* 637 */ "compare_op ::= NK_LE", - /* 638 */ "compare_op ::= NK_GE", - /* 639 */ "compare_op ::= NK_NE", - /* 640 */ "compare_op ::= NK_EQ", - /* 641 */ "compare_op ::= LIKE", - /* 642 */ "compare_op ::= NOT LIKE", - /* 643 */ "compare_op ::= MATCH", - /* 644 */ "compare_op ::= NMATCH", - /* 645 */ "compare_op ::= CONTAINS", - /* 646 */ "in_op ::= IN", - /* 647 */ "in_op ::= NOT IN", - /* 648 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 649 */ "boolean_value_expression ::= boolean_primary", - /* 650 */ "boolean_value_expression ::= NOT boolean_primary", - /* 651 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 652 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 653 */ "boolean_primary ::= predicate", - /* 654 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 655 */ "common_expression ::= expr_or_subquery", - /* 656 */ "common_expression ::= boolean_value_expression", - /* 657 */ "from_clause_opt ::=", - /* 658 */ "from_clause_opt ::= FROM table_reference_list", - /* 659 */ "table_reference_list ::= table_reference", - /* 660 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 661 */ "table_reference ::= table_primary", - /* 662 */ "table_reference ::= joined_table", - /* 663 */ "table_primary ::= table_name alias_opt", - /* 664 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 665 */ "table_primary ::= subquery alias_opt", - /* 666 */ "table_primary ::= parenthesized_joined_table", - /* 667 */ "alias_opt ::=", - /* 668 */ "alias_opt ::= table_alias", - /* 669 */ "alias_opt ::= AS table_alias", - /* 670 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 671 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 672 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt", - /* 673 */ "join_type ::=", - /* 674 */ "join_type ::= INNER", - /* 675 */ "join_type ::= LEFT", - /* 676 */ "join_type ::= RIGHT", - /* 677 */ "join_type ::= FULL", - /* 678 */ "join_subtype ::=", - /* 679 */ "join_subtype ::= OUTER", - /* 680 */ "join_subtype ::= SEMI", - /* 681 */ "join_subtype ::= ANTI", - /* 682 */ "join_subtype ::= ASOF", - /* 683 */ "join_subtype ::= WINDOW", - /* 684 */ "join_on_clause_opt ::=", - /* 685 */ "join_on_clause_opt ::= ON search_condition", - /* 686 */ "window_offset_clause_opt ::=", - /* 687 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP", - /* 688 */ "window_offset_literal ::= NK_VARIABLE", - /* 689 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE", - /* 690 */ "jlimit_clause_opt ::=", - /* 691 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER", - /* 692 */ "query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 693 */ "hint_list ::=", - /* 694 */ "hint_list ::= NK_HINT", - /* 695 */ "tag_mode_opt ::=", - /* 696 */ "tag_mode_opt ::= TAGS", - /* 697 */ "set_quantifier_opt ::=", - /* 698 */ "set_quantifier_opt ::= DISTINCT", - /* 699 */ "set_quantifier_opt ::= ALL", - /* 700 */ "select_list ::= select_item", - /* 701 */ "select_list ::= select_list NK_COMMA select_item", - /* 702 */ "select_item ::= NK_STAR", - /* 703 */ "select_item ::= common_expression", - /* 704 */ "select_item ::= common_expression column_alias", - /* 705 */ "select_item ::= common_expression AS column_alias", - /* 706 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 707 */ "where_clause_opt ::=", - /* 708 */ "where_clause_opt ::= WHERE search_condition", - /* 709 */ "partition_by_clause_opt ::=", - /* 710 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 711 */ "partition_list ::= partition_item", - /* 712 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 713 */ "partition_item ::= expr_or_subquery", - /* 714 */ "partition_item ::= expr_or_subquery column_alias", - /* 715 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 716 */ "twindow_clause_opt ::=", - /* 717 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", - /* 718 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 719 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 720 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 721 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 722 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", - /* 723 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 724 */ "twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_RP", - /* 725 */ "twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_COMMA NK_STRING NK_RP", - /* 726 */ "sliding_opt ::=", - /* 727 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", - /* 728 */ "interval_sliding_duration_literal ::= NK_VARIABLE", - /* 729 */ "interval_sliding_duration_literal ::= NK_STRING", - /* 730 */ "interval_sliding_duration_literal ::= NK_INTEGER", - /* 731 */ "fill_opt ::=", - /* 732 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 733 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 734 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 735 */ "fill_mode ::= NONE", - /* 736 */ "fill_mode ::= PREV", - /* 737 */ "fill_mode ::= NULL", - /* 738 */ "fill_mode ::= NULL_F", - /* 739 */ "fill_mode ::= LINEAR", - /* 740 */ "fill_mode ::= NEXT", - /* 741 */ "group_by_clause_opt ::=", - /* 742 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 743 */ "group_by_list ::= expr_or_subquery", - /* 744 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 745 */ "having_clause_opt ::=", - /* 746 */ "having_clause_opt ::= HAVING search_condition", - /* 747 */ "range_opt ::=", - /* 748 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 749 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", - /* 750 */ "every_opt ::=", - /* 751 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 752 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 753 */ "query_simple ::= query_specification", - /* 754 */ "query_simple ::= union_query_expression", - /* 755 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 756 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 757 */ "query_simple_or_subquery ::= query_simple", - /* 758 */ "query_simple_or_subquery ::= subquery", - /* 759 */ "query_or_subquery ::= query_expression", - /* 760 */ "query_or_subquery ::= subquery", - /* 761 */ "order_by_clause_opt ::=", - /* 762 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 763 */ "slimit_clause_opt ::=", - /* 764 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 765 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 766 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 767 */ "limit_clause_opt ::=", - /* 768 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 769 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 770 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 771 */ "subquery ::= NK_LP query_expression NK_RP", - /* 772 */ "subquery ::= NK_LP subquery NK_RP", - /* 773 */ "search_condition ::= common_expression", - /* 774 */ "sort_specification_list ::= sort_specification", - /* 775 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 776 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 777 */ "ordering_specification_opt ::=", - /* 778 */ "ordering_specification_opt ::= ASC", - /* 779 */ "ordering_specification_opt ::= DESC", - /* 780 */ "null_ordering_opt ::=", - /* 781 */ "null_ordering_opt ::= NULLS FIRST", - /* 782 */ "null_ordering_opt ::= NULLS LAST", - /* 783 */ "column_options ::=", - /* 784 */ "column_options ::= column_options PRIMARY KEY", - /* 785 */ "column_options ::= column_options NK_ID NK_STRING", -}; -#endif /* NDEBUG */ - - -#if YYSTACKDEPTH<=0 -/* -** Try to increase the size of the parser stack. Return the number -** of errors. Return 0 on success. -*/ -static int yyGrowStack(yyParser *p){ - int newSize; - int idx; - yyStackEntry *pNew; - - newSize = p->yystksz*2 + 100; - idx = p->yytos ? (int)(p->yytos - p->yystack) : 0; - if( p->yystack==&p->yystk0 ){ - pNew = malloc(newSize*sizeof(pNew[0])); - if( pNew ) pNew[0] = p->yystk0; - }else{ - pNew = realloc(p->yystack, newSize*sizeof(pNew[0])); - } - if( pNew ){ - p->yystack = pNew; - p->yytos = &p->yystack[idx]; -#ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n", - yyTracePrompt, p->yystksz, newSize); - } -#endif - p->yystksz = newSize; - } - return pNew==0; -} -#endif - -/* Datatype of the argument to the memory allocated passed as the -** second argument to ParseAlloc() below. This can be changed by -** 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. -*/ -void ParseInit(void *yypRawParser ParseCTX_PDECL){ - yyParser *yypParser = (yyParser*)yypRawParser; - ParseCTX_STORE -#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 -} - -#ifndef Parse_ENGINEALWAYSONSTACK -/* -** 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 -** to Parse and ParseFree. -*/ -void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){ - yyParser *yypParser; - yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); - if( yypParser ){ - ParseCTX_STORE - ParseInit(yypParser ParseCTX_PARAM); - } - return (void*)yypParser; -} -#endif /* Parse_ENGINEALWAYSONSTACK */ - - -/* 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 */ -){ - ParseARG_FETCH - ParseCTX_FETCH - 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 */ - case 390: /* cmd */ - case 393: /* literal */ - case 404: /* with_clause_opt */ - case 410: /* search_condition */ - case 415: /* db_options */ - case 417: /* alter_db_options */ - case 419: /* start_opt */ - case 420: /* end_opt */ - case 424: /* signed */ - case 426: /* retention */ - case 427: /* full_table_name */ - case 430: /* table_options */ - case 436: /* alter_table_clause */ - case 437: /* alter_table_options */ - case 440: /* column_options */ - case 441: /* tags_literal */ - case 442: /* create_subtable_clause */ - case 445: /* drop_table_clause */ - case 448: /* tag_def */ - case 449: /* column_def */ - case 454: /* duration_literal */ - case 455: /* rollup_func_name */ - case 457: /* col_name */ - case 460: /* like_pattern_opt */ - case 461: /* db_name_cond_opt */ - case 462: /* table_name_cond */ - case 463: /* from_db_opt */ - case 465: /* tag_item */ - case 469: /* full_tsma_name */ - case 471: /* index_options */ - case 472: /* full_index_name */ - case 474: /* sliding_opt */ - case 475: /* sma_stream_opt */ - case 476: /* func */ - case 480: /* query_or_subquery */ - case 481: /* where_clause_opt */ - case 484: /* explain_options */ - case 485: /* insert_query */ - case 490: /* full_view_name */ - case 493: /* stream_options */ - case 496: /* subtable_opt */ - case 499: /* column_stream_def */ - case 500: /* stream_col_options */ - case 501: /* expression */ - case 504: /* literal_func */ - case 505: /* signed_literal */ - case 508: /* expr_or_subquery */ - case 509: /* pseudo_column */ - case 510: /* column_reference */ - case 511: /* function_expression */ - case 512: /* case_when_expression */ - case 517: /* rand_func */ - case 520: /* star_func_para */ - case 522: /* case_when_else_opt */ - case 523: /* common_expression */ - case 524: /* when_then_expr */ - case 525: /* predicate */ - case 528: /* in_predicate_value */ - case 529: /* boolean_value_expression */ - case 530: /* boolean_primary */ - case 531: /* from_clause_opt */ - case 532: /* table_reference_list */ - case 533: /* table_reference */ - case 534: /* table_primary */ - case 535: /* joined_table */ - case 537: /* subquery */ - case 538: /* parenthesized_joined_table */ - case 541: /* join_on_clause_opt */ - case 542: /* window_offset_clause_opt */ - case 543: /* jlimit_clause_opt */ - case 544: /* window_offset_literal */ - case 545: /* query_specification */ - case 551: /* range_opt */ - case 552: /* every_opt */ - case 553: /* fill_opt */ - case 554: /* twindow_clause_opt */ - case 556: /* having_clause_opt */ - case 557: /* select_item */ - case 559: /* partition_item */ - case 560: /* interval_sliding_duration_literal */ - case 563: /* query_expression */ - case 564: /* query_simple */ - case 566: /* slimit_clause_opt */ - case 567: /* limit_clause_opt */ - case 568: /* union_query_expression */ - case 569: /* query_simple_or_subquery */ - case 571: /* sort_specification */ -{ - nodesDestroyNode((yypminor->yy980)); -} - break; - case 391: /* account_options */ - case 392: /* alter_account_options */ - case 394: /* alter_account_option */ - case 418: /* speed_opt */ - case 479: /* with_meta */ - case 488: /* bufsize_opt */ -{ - -} - break; - case 395: /* ip_range_list */ - case 396: /* white_list */ - case 397: /* white_list_opt */ - case 421: /* integer_list */ - case 422: /* variable_list */ - case 423: /* retention_list */ - case 428: /* column_def_list */ - case 429: /* tags_def_opt */ - case 431: /* multi_create_clause */ - case 432: /* tag_list_opt */ - case 433: /* tags_def */ - case 435: /* multi_drop_clause */ - case 443: /* specific_cols_opt */ - case 444: /* tags_literal_list */ - case 446: /* col_name_list */ - case 447: /* tag_def_list */ - case 451: /* duration_list */ - case 452: /* rollup_func_list */ - case 470: /* func_list */ - case 478: /* expression_list */ - case 494: /* col_list_opt */ - case 495: /* tag_def_or_ref_opt */ - case 498: /* column_stream_def_list */ - case 503: /* dnode_list */ - case 506: /* literal_list */ - case 514: /* star_func_para_list */ - case 519: /* other_para_list */ - case 521: /* when_then_list */ - case 546: /* hint_list */ - case 549: /* select_list */ - case 550: /* partition_by_clause_opt */ - case 555: /* group_by_clause_opt */ - case 558: /* partition_list */ - case 562: /* group_by_list */ - case 565: /* order_by_clause_opt */ - case 570: /* sort_specification_list */ -{ - nodesDestroyList((yypminor->yy628)); -} - break; - case 398: /* is_import_opt */ - case 399: /* is_createdb_opt */ - case 401: /* sysinfo_opt */ -{ - -} - break; - case 400: /* user_name */ - case 407: /* db_name */ - case 408: /* table_name */ - case 409: /* topic_name */ - case 411: /* dnode_endpoint */ - case 438: /* column_name */ - case 456: /* function_name */ - case 466: /* column_alias */ - case 467: /* tsma_name */ - case 473: /* index_name */ - case 477: /* sma_func_name */ - case 482: /* cgroup_name */ - case 489: /* language_opt */ - case 491: /* view_name */ - case 492: /* stream_name */ - case 502: /* on_vgroup_id */ - case 507: /* table_alias */ - case 513: /* star_func */ - case 516: /* substr_func */ - case 518: /* noarg_func */ - case 536: /* alias_opt */ -{ - -} - break; - case 402: /* privileges */ - case 405: /* priv_type_list */ - case 406: /* priv_type */ -{ - -} - break; - case 403: /* priv_level */ -{ - -} - break; - case 412: /* force_opt */ - case 413: /* unsafe_opt */ - case 414: /* not_exists_opt */ - case 416: /* exists_opt */ - case 434: /* with_opt */ - case 483: /* analyze_opt */ - case 486: /* or_replace_opt */ - case 487: /* agg_func_opt */ - case 497: /* ignore_opt */ - case 547: /* set_quantifier_opt */ - case 548: /* tag_mode_opt */ -{ - -} - break; - case 425: /* alter_db_option */ - case 453: /* alter_table_option */ -{ - -} - break; - case 439: /* type_name */ - case 450: /* type_name_default_len */ -{ - -} - break; - case 458: /* db_kind_opt */ - case 464: /* table_kind */ -{ - -} - break; - case 459: /* table_kind_db_name_cond_opt */ -{ - -} - break; - case 468: /* tsma_func_list */ -{ - nodesDestroyNode((yypminor->yy980)); -} - break; - case 515: /* trim_specification_type */ -{ - -} - break; - case 526: /* compare_op */ - case 527: /* in_op */ -{ - -} - break; - case 539: /* join_type */ -{ - -} - break; - case 540: /* join_subtype */ -{ - -} - break; - case 561: /* fill_mode */ -{ - -} - break; - case 572: /* ordering_specification_opt */ -{ - -} - break; - case 573: /* null_ordering_opt */ -{ - -} - 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 -*/ -void ParseFinalize(void *p){ - yyParser *pParser = (yyParser*)p; - while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser); -#if YYSTACKDEPTH<=0 - if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack); -#endif -} - -#ifndef Parse_ENGINEALWAYSONSTACK -/* -** 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. -*/ -void ParseFree( - void *p, /* The parser to be deleted */ - void (*freeProc)(void*) /* Function used to reclaim memory */ -){ -#ifndef YYPARSEFREENEVERNULL - if( p==0 ) return; -#endif - ParseFinalize(p); - (*freeProc)(p); -} -#endif /* Parse_ENGINEALWAYSONSTACK */ - -/* -** Return the peak depth of the stack for a parser. -*/ -#ifdef YYTRACKMAXSTACKDEPTH -int ParseStackPeak(void *p){ - 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) -int ParseCoverage(FILE *out){ - int stateno, iLookAhead, i; - int nMissed = 0; - for(stateno=0; statenoYY_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<=YY_ACTTAB_COUNT ); - assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); - assert( iLookAhead!=YYNOCODE ); - assert( iLookAhead < YYNTOKEN ); - i += iLookAhead; - assert( i<(int)YY_NLOOKAHEAD ); - if( yy_lookahead[i]!=iLookAhead ){ -#ifdef YYFALLBACK - YYCODETYPE iFallback; /* Fallback token */ - assert( iLookAhead %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; - assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) ); - if( 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{ - assert( i>=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) ); - 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 && iyytos>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 ********************************************/ - ParseARG_STORE /* Suppress warning about unused %extra_argument var */ - ParseCTX_STORE -} - -/* -** Print tracing information for a SHIFT action -*/ -#ifndef NDEBUG -static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){ - if( yyTraceFILE ){ - if( yyNewStateyytos->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 */ - ParseTOKENTYPE yyMinor /* The minor token to shift in */ -){ - 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"); -} - -/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side -** of that rule */ -static const YYCODETYPE yyRuleInfoLhs[] = { - 390, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - 390, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - 391, /* (2) account_options ::= */ - 391, /* (3) account_options ::= account_options PPS literal */ - 391, /* (4) account_options ::= account_options TSERIES literal */ - 391, /* (5) account_options ::= account_options STORAGE literal */ - 391, /* (6) account_options ::= account_options STREAMS literal */ - 391, /* (7) account_options ::= account_options QTIME literal */ - 391, /* (8) account_options ::= account_options DBS literal */ - 391, /* (9) account_options ::= account_options USERS literal */ - 391, /* (10) account_options ::= account_options CONNS literal */ - 391, /* (11) account_options ::= account_options STATE literal */ - 392, /* (12) alter_account_options ::= alter_account_option */ - 392, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - 394, /* (14) alter_account_option ::= PASS literal */ - 394, /* (15) alter_account_option ::= PPS literal */ - 394, /* (16) alter_account_option ::= TSERIES literal */ - 394, /* (17) alter_account_option ::= STORAGE literal */ - 394, /* (18) alter_account_option ::= STREAMS literal */ - 394, /* (19) alter_account_option ::= QTIME literal */ - 394, /* (20) alter_account_option ::= DBS literal */ - 394, /* (21) alter_account_option ::= USERS literal */ - 394, /* (22) alter_account_option ::= CONNS literal */ - 394, /* (23) alter_account_option ::= STATE literal */ - 395, /* (24) ip_range_list ::= NK_STRING */ - 395, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ - 396, /* (26) white_list ::= HOST ip_range_list */ - 397, /* (27) white_list_opt ::= */ - 397, /* (28) white_list_opt ::= white_list */ - 398, /* (29) is_import_opt ::= */ - 398, /* (30) is_import_opt ::= IS_IMPORT NK_INTEGER */ - 399, /* (31) is_createdb_opt ::= */ - 399, /* (32) is_createdb_opt ::= CREATEDB NK_INTEGER */ - 390, /* (33) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ - 390, /* (34) cmd ::= ALTER USER user_name PASS NK_STRING */ - 390, /* (35) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - 390, /* (36) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - 390, /* (37) cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ - 390, /* (38) cmd ::= ALTER USER user_name ADD white_list */ - 390, /* (39) cmd ::= ALTER USER user_name DROP white_list */ - 390, /* (40) cmd ::= DROP USER user_name */ - 401, /* (41) sysinfo_opt ::= */ - 401, /* (42) sysinfo_opt ::= SYSINFO NK_INTEGER */ - 390, /* (43) cmd ::= GRANT privileges ON priv_level with_clause_opt TO user_name */ - 390, /* (44) cmd ::= REVOKE privileges ON priv_level with_clause_opt FROM user_name */ - 402, /* (45) privileges ::= ALL */ - 402, /* (46) privileges ::= priv_type_list */ - 402, /* (47) privileges ::= SUBSCRIBE */ - 405, /* (48) priv_type_list ::= priv_type */ - 405, /* (49) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - 406, /* (50) priv_type ::= READ */ - 406, /* (51) priv_type ::= WRITE */ - 406, /* (52) priv_type ::= ALTER */ - 403, /* (53) priv_level ::= NK_STAR NK_DOT NK_STAR */ - 403, /* (54) priv_level ::= db_name NK_DOT NK_STAR */ - 403, /* (55) priv_level ::= db_name NK_DOT table_name */ - 403, /* (56) priv_level ::= topic_name */ - 404, /* (57) with_clause_opt ::= */ - 404, /* (58) with_clause_opt ::= WITH search_condition */ - 390, /* (59) cmd ::= CREATE ENCRYPT_KEY NK_STRING */ - 390, /* (60) cmd ::= CREATE ANODE NK_STRING */ - 390, /* (61) cmd ::= UPDATE ANODE NK_INTEGER */ - 390, /* (62) cmd ::= UPDATE ALL ANODES */ - 390, /* (63) cmd ::= DROP ANODE NK_INTEGER */ - 390, /* (64) cmd ::= CREATE DNODE dnode_endpoint */ - 390, /* (65) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - 390, /* (66) cmd ::= DROP DNODE NK_INTEGER force_opt */ - 390, /* (67) cmd ::= DROP DNODE dnode_endpoint force_opt */ - 390, /* (68) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - 390, /* (69) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - 390, /* (70) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - 390, /* (71) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - 390, /* (72) cmd ::= ALTER ALL DNODES NK_STRING */ - 390, /* (73) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - 390, /* (74) cmd ::= RESTORE DNODE NK_INTEGER */ - 411, /* (75) dnode_endpoint ::= NK_STRING */ - 411, /* (76) dnode_endpoint ::= NK_ID */ - 411, /* (77) dnode_endpoint ::= NK_IPTOKEN */ - 412, /* (78) force_opt ::= */ - 412, /* (79) force_opt ::= FORCE */ - 413, /* (80) unsafe_opt ::= UNSAFE */ - 390, /* (81) cmd ::= ALTER CLUSTER NK_STRING */ - 390, /* (82) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ - 390, /* (83) cmd ::= ALTER LOCAL NK_STRING */ - 390, /* (84) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - 390, /* (85) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - 390, /* (86) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - 390, /* (87) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - 390, /* (88) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - 390, /* (89) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - 390, /* (90) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - 390, /* (91) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - 390, /* (92) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - 390, /* (93) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - 390, /* (94) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - 390, /* (95) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - 390, /* (96) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - 390, /* (97) cmd ::= DROP DATABASE exists_opt db_name */ - 390, /* (98) cmd ::= USE db_name */ - 390, /* (99) cmd ::= ALTER DATABASE db_name alter_db_options */ - 390, /* (100) cmd ::= FLUSH DATABASE db_name */ - 390, /* (101) cmd ::= TRIM DATABASE db_name speed_opt */ - 390, /* (102) cmd ::= S3MIGRATE DATABASE db_name */ - 390, /* (103) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - 414, /* (104) not_exists_opt ::= IF NOT EXISTS */ - 414, /* (105) not_exists_opt ::= */ - 416, /* (106) exists_opt ::= IF EXISTS */ - 416, /* (107) exists_opt ::= */ - 415, /* (108) db_options ::= */ - 415, /* (109) db_options ::= db_options BUFFER NK_INTEGER */ - 415, /* (110) db_options ::= db_options CACHEMODEL NK_STRING */ - 415, /* (111) db_options ::= db_options CACHESIZE NK_INTEGER */ - 415, /* (112) db_options ::= db_options COMP NK_INTEGER */ - 415, /* (113) db_options ::= db_options DURATION NK_INTEGER */ - 415, /* (114) db_options ::= db_options DURATION NK_VARIABLE */ - 415, /* (115) db_options ::= db_options MAXROWS NK_INTEGER */ - 415, /* (116) db_options ::= db_options MINROWS NK_INTEGER */ - 415, /* (117) db_options ::= db_options KEEP integer_list */ - 415, /* (118) db_options ::= db_options KEEP variable_list */ - 415, /* (119) db_options ::= db_options PAGES NK_INTEGER */ - 415, /* (120) db_options ::= db_options PAGESIZE NK_INTEGER */ - 415, /* (121) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - 415, /* (122) db_options ::= db_options PRECISION NK_STRING */ - 415, /* (123) db_options ::= db_options REPLICA NK_INTEGER */ - 415, /* (124) db_options ::= db_options VGROUPS NK_INTEGER */ - 415, /* (125) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - 415, /* (126) db_options ::= db_options RETENTIONS retention_list */ - 415, /* (127) db_options ::= db_options SCHEMALESS NK_INTEGER */ - 415, /* (128) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - 415, /* (129) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - 415, /* (130) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - 415, /* (131) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 415, /* (132) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - 415, /* (133) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 415, /* (134) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - 415, /* (135) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - 415, /* (136) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - 415, /* (137) db_options ::= db_options TABLE_PREFIX signed */ - 415, /* (138) db_options ::= db_options TABLE_SUFFIX signed */ - 415, /* (139) db_options ::= db_options S3_CHUNKPAGES NK_INTEGER */ - 415, /* (140) db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ - 415, /* (141) db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ - 415, /* (142) db_options ::= db_options S3_COMPACT NK_INTEGER */ - 415, /* (143) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ - 415, /* (144) db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ - 415, /* (145) db_options ::= db_options DNODES NK_STRING */ - 417, /* (146) alter_db_options ::= alter_db_option */ - 417, /* (147) alter_db_options ::= alter_db_options alter_db_option */ - 425, /* (148) alter_db_option ::= BUFFER NK_INTEGER */ - 425, /* (149) alter_db_option ::= CACHEMODEL NK_STRING */ - 425, /* (150) alter_db_option ::= CACHESIZE NK_INTEGER */ - 425, /* (151) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - 425, /* (152) alter_db_option ::= KEEP integer_list */ - 425, /* (153) alter_db_option ::= KEEP variable_list */ - 425, /* (154) alter_db_option ::= PAGES NK_INTEGER */ - 425, /* (155) alter_db_option ::= REPLICA NK_INTEGER */ - 425, /* (156) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - 425, /* (157) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - 425, /* (158) alter_db_option ::= MINROWS NK_INTEGER */ - 425, /* (159) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - 425, /* (160) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 425, /* (161) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - 425, /* (162) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 425, /* (163) alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ - 425, /* (164) alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ - 425, /* (165) alter_db_option ::= S3_COMPACT NK_INTEGER */ - 425, /* (166) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ - 425, /* (167) alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ - 421, /* (168) integer_list ::= NK_INTEGER */ - 421, /* (169) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - 422, /* (170) variable_list ::= NK_VARIABLE */ - 422, /* (171) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - 423, /* (172) retention_list ::= retention */ - 423, /* (173) retention_list ::= retention_list NK_COMMA retention */ - 426, /* (174) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - 426, /* (175) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ - 418, /* (176) speed_opt ::= */ - 418, /* (177) speed_opt ::= BWLIMIT NK_INTEGER */ - 419, /* (178) start_opt ::= */ - 419, /* (179) start_opt ::= START WITH NK_INTEGER */ - 419, /* (180) start_opt ::= START WITH NK_STRING */ - 419, /* (181) start_opt ::= START WITH TIMESTAMP NK_STRING */ - 420, /* (182) end_opt ::= */ - 420, /* (183) end_opt ::= END WITH NK_INTEGER */ - 420, /* (184) end_opt ::= END WITH NK_STRING */ - 420, /* (185) end_opt ::= END WITH TIMESTAMP NK_STRING */ - 390, /* (186) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - 390, /* (187) cmd ::= CREATE TABLE multi_create_clause */ - 390, /* (188) cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ - 390, /* (189) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - 390, /* (190) cmd ::= DROP TABLE with_opt multi_drop_clause */ - 390, /* (191) cmd ::= DROP STABLE with_opt exists_opt full_table_name */ - 390, /* (192) cmd ::= ALTER TABLE alter_table_clause */ - 390, /* (193) cmd ::= ALTER STABLE alter_table_clause */ - 436, /* (194) alter_table_clause ::= full_table_name alter_table_options */ - 436, /* (195) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ - 436, /* (196) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - 436, /* (197) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - 436, /* (198) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ - 436, /* (199) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - 436, /* (200) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - 436, /* (201) alter_table_clause ::= full_table_name DROP TAG column_name */ - 436, /* (202) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - 436, /* (203) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - 436, /* (204) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ - 431, /* (205) multi_create_clause ::= create_subtable_clause */ - 431, /* (206) multi_create_clause ::= multi_create_clause create_subtable_clause */ - 442, /* (207) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ - 435, /* (208) multi_drop_clause ::= drop_table_clause */ - 435, /* (209) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - 445, /* (210) drop_table_clause ::= exists_opt full_table_name */ - 434, /* (211) with_opt ::= */ - 434, /* (212) with_opt ::= WITH */ - 443, /* (213) specific_cols_opt ::= */ - 443, /* (214) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - 427, /* (215) full_table_name ::= table_name */ - 427, /* (216) full_table_name ::= db_name NK_DOT table_name */ - 447, /* (217) tag_def_list ::= tag_def */ - 447, /* (218) tag_def_list ::= tag_def_list NK_COMMA tag_def */ - 448, /* (219) tag_def ::= column_name type_name */ - 428, /* (220) column_def_list ::= column_def */ - 428, /* (221) column_def_list ::= column_def_list NK_COMMA column_def */ - 449, /* (222) column_def ::= column_name type_name column_options */ - 439, /* (223) type_name ::= BOOL */ - 439, /* (224) type_name ::= TINYINT */ - 439, /* (225) type_name ::= SMALLINT */ - 439, /* (226) type_name ::= INT */ - 439, /* (227) type_name ::= INTEGER */ - 439, /* (228) type_name ::= BIGINT */ - 439, /* (229) type_name ::= FLOAT */ - 439, /* (230) type_name ::= DOUBLE */ - 439, /* (231) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - 439, /* (232) type_name ::= TIMESTAMP */ - 439, /* (233) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - 439, /* (234) type_name ::= TINYINT UNSIGNED */ - 439, /* (235) type_name ::= SMALLINT UNSIGNED */ - 439, /* (236) type_name ::= INT UNSIGNED */ - 439, /* (237) type_name ::= BIGINT UNSIGNED */ - 439, /* (238) type_name ::= JSON */ - 439, /* (239) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - 439, /* (240) type_name ::= MEDIUMBLOB */ - 439, /* (241) type_name ::= BLOB */ - 439, /* (242) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - 439, /* (243) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - 439, /* (244) type_name ::= DECIMAL */ - 439, /* (245) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - 439, /* (246) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 450, /* (247) type_name_default_len ::= BINARY */ - 450, /* (248) type_name_default_len ::= NCHAR */ - 450, /* (249) type_name_default_len ::= VARCHAR */ - 450, /* (250) type_name_default_len ::= VARBINARY */ - 429, /* (251) tags_def_opt ::= */ - 429, /* (252) tags_def_opt ::= tags_def */ - 433, /* (253) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ - 430, /* (254) table_options ::= */ - 430, /* (255) table_options ::= table_options COMMENT NK_STRING */ - 430, /* (256) table_options ::= table_options MAX_DELAY duration_list */ - 430, /* (257) table_options ::= table_options WATERMARK duration_list */ - 430, /* (258) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - 430, /* (259) table_options ::= table_options TTL NK_INTEGER */ - 430, /* (260) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - 430, /* (261) table_options ::= table_options DELETE_MARK duration_list */ - 437, /* (262) alter_table_options ::= alter_table_option */ - 437, /* (263) alter_table_options ::= alter_table_options alter_table_option */ - 453, /* (264) alter_table_option ::= COMMENT NK_STRING */ - 453, /* (265) alter_table_option ::= TTL NK_INTEGER */ - 451, /* (266) duration_list ::= duration_literal */ - 451, /* (267) duration_list ::= duration_list NK_COMMA duration_literal */ - 452, /* (268) rollup_func_list ::= rollup_func_name */ - 452, /* (269) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - 455, /* (270) rollup_func_name ::= function_name */ - 455, /* (271) rollup_func_name ::= FIRST */ - 455, /* (272) rollup_func_name ::= LAST */ - 446, /* (273) col_name_list ::= col_name */ - 446, /* (274) col_name_list ::= col_name_list NK_COMMA col_name */ - 457, /* (275) col_name ::= column_name */ - 390, /* (276) cmd ::= SHOW DNODES */ - 390, /* (277) cmd ::= SHOW USERS */ - 390, /* (278) cmd ::= SHOW USERS FULL */ - 390, /* (279) cmd ::= SHOW USER PRIVILEGES */ - 390, /* (280) cmd ::= SHOW db_kind_opt DATABASES */ - 390, /* (281) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - 390, /* (282) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - 390, /* (283) cmd ::= SHOW db_name_cond_opt VGROUPS */ - 390, /* (284) cmd ::= SHOW MNODES */ - 390, /* (285) cmd ::= SHOW QNODES */ - 390, /* (286) cmd ::= SHOW ANODES */ - 390, /* (287) cmd ::= SHOW ANODES FULL */ - 390, /* (288) cmd ::= SHOW ARBGROUPS */ - 390, /* (289) cmd ::= SHOW FUNCTIONS */ - 390, /* (290) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - 390, /* (291) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - 390, /* (292) cmd ::= SHOW STREAMS */ - 390, /* (293) cmd ::= SHOW ACCOUNTS */ - 390, /* (294) cmd ::= SHOW APPS */ - 390, /* (295) cmd ::= SHOW CONNECTIONS */ - 390, /* (296) cmd ::= SHOW LICENCES */ - 390, /* (297) cmd ::= SHOW GRANTS */ - 390, /* (298) cmd ::= SHOW GRANTS FULL */ - 390, /* (299) cmd ::= SHOW GRANTS LOGS */ - 390, /* (300) cmd ::= SHOW CLUSTER MACHINES */ - 390, /* (301) cmd ::= SHOW CREATE DATABASE db_name */ - 390, /* (302) cmd ::= SHOW CREATE TABLE full_table_name */ - 390, /* (303) cmd ::= SHOW CREATE STABLE full_table_name */ - 390, /* (304) cmd ::= SHOW ENCRYPTIONS */ - 390, /* (305) cmd ::= SHOW QUERIES */ - 390, /* (306) cmd ::= SHOW SCORES */ - 390, /* (307) cmd ::= SHOW TOPICS */ - 390, /* (308) cmd ::= SHOW VARIABLES */ - 390, /* (309) cmd ::= SHOW CLUSTER VARIABLES */ - 390, /* (310) cmd ::= SHOW LOCAL VARIABLES */ - 390, /* (311) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - 390, /* (312) cmd ::= SHOW BNODES */ - 390, /* (313) cmd ::= SHOW SNODES */ - 390, /* (314) cmd ::= SHOW CLUSTER */ - 390, /* (315) cmd ::= SHOW TRANSACTIONS */ - 390, /* (316) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - 390, /* (317) cmd ::= SHOW CONSUMERS */ - 390, /* (318) cmd ::= SHOW SUBSCRIPTIONS */ - 390, /* (319) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - 390, /* (320) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - 390, /* (321) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - 390, /* (322) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - 390, /* (323) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - 390, /* (324) cmd ::= SHOW VNODES */ - 390, /* (325) cmd ::= SHOW db_name_cond_opt ALIVE */ - 390, /* (326) cmd ::= SHOW CLUSTER ALIVE */ - 390, /* (327) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - 390, /* (328) cmd ::= SHOW CREATE VIEW full_table_name */ - 390, /* (329) cmd ::= SHOW COMPACTS */ - 390, /* (330) cmd ::= SHOW COMPACT NK_INTEGER */ - 459, /* (331) table_kind_db_name_cond_opt ::= */ - 459, /* (332) table_kind_db_name_cond_opt ::= table_kind */ - 459, /* (333) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - 459, /* (334) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - 464, /* (335) table_kind ::= NORMAL */ - 464, /* (336) table_kind ::= CHILD */ - 461, /* (337) db_name_cond_opt ::= */ - 461, /* (338) db_name_cond_opt ::= db_name NK_DOT */ - 460, /* (339) like_pattern_opt ::= */ - 460, /* (340) like_pattern_opt ::= LIKE NK_STRING */ - 462, /* (341) table_name_cond ::= table_name */ - 463, /* (342) from_db_opt ::= */ - 463, /* (343) from_db_opt ::= FROM db_name */ - 432, /* (344) tag_list_opt ::= */ - 432, /* (345) tag_list_opt ::= tag_item */ - 432, /* (346) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - 465, /* (347) tag_item ::= TBNAME */ - 465, /* (348) tag_item ::= QTAGS */ - 465, /* (349) tag_item ::= column_name */ - 465, /* (350) tag_item ::= column_name column_alias */ - 465, /* (351) tag_item ::= column_name AS column_alias */ - 458, /* (352) db_kind_opt ::= */ - 458, /* (353) db_kind_opt ::= USER */ - 458, /* (354) db_kind_opt ::= SYSTEM */ - 390, /* (355) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ - 390, /* (356) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ - 390, /* (357) cmd ::= DROP TSMA exists_opt full_tsma_name */ - 390, /* (358) cmd ::= SHOW db_name_cond_opt TSMAS */ - 469, /* (359) full_tsma_name ::= tsma_name */ - 469, /* (360) full_tsma_name ::= db_name NK_DOT tsma_name */ - 468, /* (361) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ - 390, /* (362) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - 390, /* (363) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - 390, /* (364) cmd ::= DROP INDEX exists_opt full_index_name */ - 472, /* (365) full_index_name ::= index_name */ - 472, /* (366) full_index_name ::= db_name NK_DOT index_name */ - 471, /* (367) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - 471, /* (368) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - 470, /* (369) func_list ::= func */ - 470, /* (370) func_list ::= func_list NK_COMMA func */ - 476, /* (371) func ::= sma_func_name NK_LP expression_list NK_RP */ - 477, /* (372) sma_func_name ::= function_name */ - 477, /* (373) sma_func_name ::= COUNT */ - 477, /* (374) sma_func_name ::= FIRST */ - 477, /* (375) sma_func_name ::= LAST */ - 477, /* (376) sma_func_name ::= LAST_ROW */ - 475, /* (377) sma_stream_opt ::= */ - 475, /* (378) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - 475, /* (379) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - 475, /* (380) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - 479, /* (381) with_meta ::= AS */ - 479, /* (382) with_meta ::= WITH META AS */ - 479, /* (383) with_meta ::= ONLY META AS */ - 390, /* (384) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - 390, /* (385) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - 390, /* (386) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - 390, /* (387) cmd ::= DROP TOPIC exists_opt topic_name */ - 390, /* (388) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - 390, /* (389) cmd ::= DESC full_table_name */ - 390, /* (390) cmd ::= DESCRIBE full_table_name */ - 390, /* (391) cmd ::= RESET QUERY CACHE */ - 390, /* (392) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - 390, /* (393) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 483, /* (394) analyze_opt ::= */ - 483, /* (395) analyze_opt ::= ANALYZE */ - 484, /* (396) explain_options ::= */ - 484, /* (397) explain_options ::= explain_options VERBOSE NK_BOOL */ - 484, /* (398) explain_options ::= explain_options RATIO NK_FLOAT */ - 390, /* (399) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - 390, /* (400) cmd ::= DROP FUNCTION exists_opt function_name */ - 487, /* (401) agg_func_opt ::= */ - 487, /* (402) agg_func_opt ::= AGGREGATE */ - 488, /* (403) bufsize_opt ::= */ - 488, /* (404) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 489, /* (405) language_opt ::= */ - 489, /* (406) language_opt ::= LANGUAGE NK_STRING */ - 486, /* (407) or_replace_opt ::= */ - 486, /* (408) or_replace_opt ::= OR REPLACE */ - 390, /* (409) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - 390, /* (410) cmd ::= DROP VIEW exists_opt full_view_name */ - 490, /* (411) full_view_name ::= view_name */ - 490, /* (412) full_view_name ::= db_name NK_DOT view_name */ - 390, /* (413) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - 390, /* (414) cmd ::= DROP STREAM exists_opt stream_name */ - 390, /* (415) cmd ::= PAUSE STREAM exists_opt stream_name */ - 390, /* (416) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 494, /* (417) col_list_opt ::= */ - 494, /* (418) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ - 498, /* (419) column_stream_def_list ::= column_stream_def */ - 498, /* (420) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ - 499, /* (421) column_stream_def ::= column_name stream_col_options */ - 500, /* (422) stream_col_options ::= */ - 500, /* (423) stream_col_options ::= stream_col_options PRIMARY KEY */ - 495, /* (424) tag_def_or_ref_opt ::= */ - 495, /* (425) tag_def_or_ref_opt ::= tags_def */ - 495, /* (426) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ - 493, /* (427) stream_options ::= */ - 493, /* (428) stream_options ::= stream_options TRIGGER AT_ONCE */ - 493, /* (429) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - 493, /* (430) stream_options ::= stream_options TRIGGER FORCE_WINDOW_CLOSE */ - 493, /* (431) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - 493, /* (432) stream_options ::= stream_options WATERMARK duration_literal */ - 493, /* (433) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - 493, /* (434) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - 493, /* (435) stream_options ::= stream_options DELETE_MARK duration_literal */ - 493, /* (436) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 496, /* (437) subtable_opt ::= */ - 496, /* (438) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 497, /* (439) ignore_opt ::= */ - 497, /* (440) ignore_opt ::= IGNORE UNTREATED */ - 390, /* (441) cmd ::= KILL CONNECTION NK_INTEGER */ - 390, /* (442) cmd ::= KILL QUERY NK_STRING */ - 390, /* (443) cmd ::= KILL TRANSACTION NK_INTEGER */ - 390, /* (444) cmd ::= KILL COMPACT NK_INTEGER */ - 390, /* (445) cmd ::= BALANCE VGROUP */ - 390, /* (446) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - 390, /* (447) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ - 390, /* (448) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - 390, /* (449) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - 390, /* (450) cmd ::= SPLIT VGROUP NK_INTEGER */ - 502, /* (451) on_vgroup_id ::= */ - 502, /* (452) on_vgroup_id ::= ON NK_INTEGER */ - 503, /* (453) dnode_list ::= DNODE NK_INTEGER */ - 503, /* (454) dnode_list ::= dnode_list DNODE NK_INTEGER */ - 390, /* (455) cmd ::= DELETE FROM full_table_name where_clause_opt */ - 390, /* (456) cmd ::= query_or_subquery */ - 390, /* (457) cmd ::= insert_query */ - 485, /* (458) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - 485, /* (459) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - 441, /* (460) tags_literal ::= NK_INTEGER */ - 441, /* (461) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - 441, /* (462) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ - 441, /* (463) tags_literal ::= NK_PLUS NK_INTEGER */ - 441, /* (464) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - 441, /* (465) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ - 441, /* (466) tags_literal ::= NK_MINUS NK_INTEGER */ - 441, /* (467) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ - 441, /* (468) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ - 441, /* (469) tags_literal ::= NK_FLOAT */ - 441, /* (470) tags_literal ::= NK_PLUS NK_FLOAT */ - 441, /* (471) tags_literal ::= NK_MINUS NK_FLOAT */ - 441, /* (472) tags_literal ::= NK_BIN */ - 441, /* (473) tags_literal ::= NK_BIN NK_PLUS duration_literal */ - 441, /* (474) tags_literal ::= NK_BIN NK_MINUS duration_literal */ - 441, /* (475) tags_literal ::= NK_PLUS NK_BIN */ - 441, /* (476) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ - 441, /* (477) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ - 441, /* (478) tags_literal ::= NK_MINUS NK_BIN */ - 441, /* (479) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ - 441, /* (480) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ - 441, /* (481) tags_literal ::= NK_HEX */ - 441, /* (482) tags_literal ::= NK_HEX NK_PLUS duration_literal */ - 441, /* (483) tags_literal ::= NK_HEX NK_MINUS duration_literal */ - 441, /* (484) tags_literal ::= NK_PLUS NK_HEX */ - 441, /* (485) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ - 441, /* (486) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ - 441, /* (487) tags_literal ::= NK_MINUS NK_HEX */ - 441, /* (488) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ - 441, /* (489) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ - 441, /* (490) tags_literal ::= NK_STRING */ - 441, /* (491) tags_literal ::= NK_STRING NK_PLUS duration_literal */ - 441, /* (492) tags_literal ::= NK_STRING NK_MINUS duration_literal */ - 441, /* (493) tags_literal ::= NK_BOOL */ - 441, /* (494) tags_literal ::= NULL */ - 441, /* (495) tags_literal ::= literal_func */ - 441, /* (496) tags_literal ::= literal_func NK_PLUS duration_literal */ - 441, /* (497) tags_literal ::= literal_func NK_MINUS duration_literal */ - 444, /* (498) tags_literal_list ::= tags_literal */ - 444, /* (499) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - 393, /* (500) literal ::= NK_INTEGER */ - 393, /* (501) literal ::= NK_FLOAT */ - 393, /* (502) literal ::= NK_STRING */ - 393, /* (503) literal ::= NK_BOOL */ - 393, /* (504) literal ::= TIMESTAMP NK_STRING */ - 393, /* (505) literal ::= duration_literal */ - 393, /* (506) literal ::= NULL */ - 393, /* (507) literal ::= NK_QUESTION */ - 454, /* (508) duration_literal ::= NK_VARIABLE */ - 424, /* (509) signed ::= NK_INTEGER */ - 424, /* (510) signed ::= NK_PLUS NK_INTEGER */ - 424, /* (511) signed ::= NK_MINUS NK_INTEGER */ - 424, /* (512) signed ::= NK_FLOAT */ - 424, /* (513) signed ::= NK_PLUS NK_FLOAT */ - 424, /* (514) signed ::= NK_MINUS NK_FLOAT */ - 505, /* (515) signed_literal ::= signed */ - 505, /* (516) signed_literal ::= NK_STRING */ - 505, /* (517) signed_literal ::= NK_BOOL */ - 505, /* (518) signed_literal ::= TIMESTAMP NK_STRING */ - 505, /* (519) signed_literal ::= duration_literal */ - 505, /* (520) signed_literal ::= NULL */ - 505, /* (521) signed_literal ::= literal_func */ - 505, /* (522) signed_literal ::= NK_QUESTION */ - 506, /* (523) literal_list ::= signed_literal */ - 506, /* (524) literal_list ::= literal_list NK_COMMA signed_literal */ - 407, /* (525) db_name ::= NK_ID */ - 408, /* (526) table_name ::= NK_ID */ - 438, /* (527) column_name ::= NK_ID */ - 456, /* (528) function_name ::= NK_ID */ - 491, /* (529) view_name ::= NK_ID */ - 507, /* (530) table_alias ::= NK_ID */ - 466, /* (531) column_alias ::= NK_ID */ - 466, /* (532) column_alias ::= NK_ALIAS */ - 400, /* (533) user_name ::= NK_ID */ - 409, /* (534) topic_name ::= NK_ID */ - 492, /* (535) stream_name ::= NK_ID */ - 482, /* (536) cgroup_name ::= NK_ID */ - 473, /* (537) index_name ::= NK_ID */ - 467, /* (538) tsma_name ::= NK_ID */ - 508, /* (539) expr_or_subquery ::= expression */ - 501, /* (540) expression ::= literal */ - 501, /* (541) expression ::= pseudo_column */ - 501, /* (542) expression ::= column_reference */ - 501, /* (543) expression ::= function_expression */ - 501, /* (544) expression ::= case_when_expression */ - 501, /* (545) expression ::= NK_LP expression NK_RP */ - 501, /* (546) expression ::= NK_PLUS expr_or_subquery */ - 501, /* (547) expression ::= NK_MINUS expr_or_subquery */ - 501, /* (548) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - 501, /* (549) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - 501, /* (550) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - 501, /* (551) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - 501, /* (552) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - 501, /* (553) expression ::= column_reference NK_ARROW NK_STRING */ - 501, /* (554) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - 501, /* (555) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - 478, /* (556) expression_list ::= expr_or_subquery */ - 478, /* (557) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - 510, /* (558) column_reference ::= column_name */ - 510, /* (559) column_reference ::= table_name NK_DOT column_name */ - 510, /* (560) column_reference ::= NK_ALIAS */ - 510, /* (561) column_reference ::= table_name NK_DOT NK_ALIAS */ - 509, /* (562) pseudo_column ::= ROWTS */ - 509, /* (563) pseudo_column ::= TBNAME */ - 509, /* (564) pseudo_column ::= table_name NK_DOT TBNAME */ - 509, /* (565) pseudo_column ::= QSTART */ - 509, /* (566) pseudo_column ::= QEND */ - 509, /* (567) pseudo_column ::= QDURATION */ - 509, /* (568) pseudo_column ::= WSTART */ - 509, /* (569) pseudo_column ::= WEND */ - 509, /* (570) pseudo_column ::= WDURATION */ - 509, /* (571) pseudo_column ::= IROWTS */ - 509, /* (572) pseudo_column ::= ISFILLED */ - 509, /* (573) pseudo_column ::= QTAGS */ - 509, /* (574) pseudo_column ::= FLOW */ - 509, /* (575) pseudo_column ::= FHIGH */ - 509, /* (576) pseudo_column ::= FROWTS */ - 511, /* (577) function_expression ::= function_name NK_LP expression_list NK_RP */ - 511, /* (578) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - 511, /* (579) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - 511, /* (580) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ - 511, /* (581) function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP */ - 511, /* (582) function_expression ::= TRIM NK_LP expr_or_subquery NK_RP */ - 511, /* (583) function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP */ - 511, /* (584) function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ - 511, /* (585) function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP */ - 511, /* (586) function_expression ::= substr_func NK_LP expression_list NK_RP */ - 511, /* (587) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ - 511, /* (588) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP */ - 511, /* (589) function_expression ::= REPLACE NK_LP expression_list NK_RP */ - 511, /* (590) function_expression ::= literal_func */ - 511, /* (591) function_expression ::= rand_func */ - 504, /* (592) literal_func ::= noarg_func NK_LP NK_RP */ - 504, /* (593) literal_func ::= NOW */ - 504, /* (594) literal_func ::= TODAY */ - 517, /* (595) rand_func ::= RAND NK_LP NK_RP */ - 517, /* (596) rand_func ::= RAND NK_LP expression_list NK_RP */ - 516, /* (597) substr_func ::= SUBSTR */ - 516, /* (598) substr_func ::= SUBSTRING */ - 515, /* (599) trim_specification_type ::= BOTH */ - 515, /* (600) trim_specification_type ::= TRAILING */ - 515, /* (601) trim_specification_type ::= LEADING */ - 518, /* (602) noarg_func ::= NOW */ - 518, /* (603) noarg_func ::= TODAY */ - 518, /* (604) noarg_func ::= TIMEZONE */ - 518, /* (605) noarg_func ::= DATABASE */ - 518, /* (606) noarg_func ::= CLIENT_VERSION */ - 518, /* (607) noarg_func ::= SERVER_VERSION */ - 518, /* (608) noarg_func ::= SERVER_STATUS */ - 518, /* (609) noarg_func ::= CURRENT_USER */ - 518, /* (610) noarg_func ::= USER */ - 518, /* (611) noarg_func ::= PI */ - 513, /* (612) star_func ::= COUNT */ - 513, /* (613) star_func ::= FIRST */ - 513, /* (614) star_func ::= LAST */ - 513, /* (615) star_func ::= LAST_ROW */ - 514, /* (616) star_func_para_list ::= NK_STAR */ - 514, /* (617) star_func_para_list ::= other_para_list */ - 519, /* (618) other_para_list ::= star_func_para */ - 519, /* (619) other_para_list ::= other_para_list NK_COMMA star_func_para */ - 520, /* (620) star_func_para ::= expr_or_subquery */ - 520, /* (621) star_func_para ::= table_name NK_DOT NK_STAR */ - 512, /* (622) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - 512, /* (623) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - 521, /* (624) when_then_list ::= when_then_expr */ - 521, /* (625) when_then_list ::= when_then_list when_then_expr */ - 524, /* (626) when_then_expr ::= WHEN common_expression THEN common_expression */ - 522, /* (627) case_when_else_opt ::= */ - 522, /* (628) case_when_else_opt ::= ELSE common_expression */ - 525, /* (629) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - 525, /* (630) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - 525, /* (631) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - 525, /* (632) predicate ::= expr_or_subquery IS NULL */ - 525, /* (633) predicate ::= expr_or_subquery IS NOT NULL */ - 525, /* (634) predicate ::= expr_or_subquery in_op in_predicate_value */ - 526, /* (635) compare_op ::= NK_LT */ - 526, /* (636) compare_op ::= NK_GT */ - 526, /* (637) compare_op ::= NK_LE */ - 526, /* (638) compare_op ::= NK_GE */ - 526, /* (639) compare_op ::= NK_NE */ - 526, /* (640) compare_op ::= NK_EQ */ - 526, /* (641) compare_op ::= LIKE */ - 526, /* (642) compare_op ::= NOT LIKE */ - 526, /* (643) compare_op ::= MATCH */ - 526, /* (644) compare_op ::= NMATCH */ - 526, /* (645) compare_op ::= CONTAINS */ - 527, /* (646) in_op ::= IN */ - 527, /* (647) in_op ::= NOT IN */ - 528, /* (648) in_predicate_value ::= NK_LP literal_list NK_RP */ - 529, /* (649) boolean_value_expression ::= boolean_primary */ - 529, /* (650) boolean_value_expression ::= NOT boolean_primary */ - 529, /* (651) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - 529, /* (652) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - 530, /* (653) boolean_primary ::= predicate */ - 530, /* (654) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - 523, /* (655) common_expression ::= expr_or_subquery */ - 523, /* (656) common_expression ::= boolean_value_expression */ - 531, /* (657) from_clause_opt ::= */ - 531, /* (658) from_clause_opt ::= FROM table_reference_list */ - 532, /* (659) table_reference_list ::= table_reference */ - 532, /* (660) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - 533, /* (661) table_reference ::= table_primary */ - 533, /* (662) table_reference ::= joined_table */ - 534, /* (663) table_primary ::= table_name alias_opt */ - 534, /* (664) table_primary ::= db_name NK_DOT table_name alias_opt */ - 534, /* (665) table_primary ::= subquery alias_opt */ - 534, /* (666) table_primary ::= parenthesized_joined_table */ - 536, /* (667) alias_opt ::= */ - 536, /* (668) alias_opt ::= table_alias */ - 536, /* (669) alias_opt ::= AS table_alias */ - 538, /* (670) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - 538, /* (671) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - 535, /* (672) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ - 539, /* (673) join_type ::= */ - 539, /* (674) join_type ::= INNER */ - 539, /* (675) join_type ::= LEFT */ - 539, /* (676) join_type ::= RIGHT */ - 539, /* (677) join_type ::= FULL */ - 540, /* (678) join_subtype ::= */ - 540, /* (679) join_subtype ::= OUTER */ - 540, /* (680) join_subtype ::= SEMI */ - 540, /* (681) join_subtype ::= ANTI */ - 540, /* (682) join_subtype ::= ASOF */ - 540, /* (683) join_subtype ::= WINDOW */ - 541, /* (684) join_on_clause_opt ::= */ - 541, /* (685) join_on_clause_opt ::= ON search_condition */ - 542, /* (686) window_offset_clause_opt ::= */ - 542, /* (687) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ - 544, /* (688) window_offset_literal ::= NK_VARIABLE */ - 544, /* (689) window_offset_literal ::= NK_MINUS NK_VARIABLE */ - 543, /* (690) jlimit_clause_opt ::= */ - 543, /* (691) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - 545, /* (692) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 546, /* (693) hint_list ::= */ - 546, /* (694) hint_list ::= NK_HINT */ - 548, /* (695) tag_mode_opt ::= */ - 548, /* (696) tag_mode_opt ::= TAGS */ - 547, /* (697) set_quantifier_opt ::= */ - 547, /* (698) set_quantifier_opt ::= DISTINCT */ - 547, /* (699) set_quantifier_opt ::= ALL */ - 549, /* (700) select_list ::= select_item */ - 549, /* (701) select_list ::= select_list NK_COMMA select_item */ - 557, /* (702) select_item ::= NK_STAR */ - 557, /* (703) select_item ::= common_expression */ - 557, /* (704) select_item ::= common_expression column_alias */ - 557, /* (705) select_item ::= common_expression AS column_alias */ - 557, /* (706) select_item ::= table_name NK_DOT NK_STAR */ - 481, /* (707) where_clause_opt ::= */ - 481, /* (708) where_clause_opt ::= WHERE search_condition */ - 550, /* (709) partition_by_clause_opt ::= */ - 550, /* (710) partition_by_clause_opt ::= PARTITION BY partition_list */ - 558, /* (711) partition_list ::= partition_item */ - 558, /* (712) partition_list ::= partition_list NK_COMMA partition_item */ - 559, /* (713) partition_item ::= expr_or_subquery */ - 559, /* (714) partition_item ::= expr_or_subquery column_alias */ - 559, /* (715) partition_item ::= expr_or_subquery AS column_alias */ - 554, /* (716) twindow_clause_opt ::= */ - 554, /* (717) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - 554, /* (718) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 554, /* (719) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 554, /* (720) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 554, /* (721) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 554, /* (722) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - 554, /* (723) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 554, /* (724) twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_RP */ - 554, /* (725) twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_COMMA NK_STRING NK_RP */ - 474, /* (726) sliding_opt ::= */ - 474, /* (727) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - 560, /* (728) interval_sliding_duration_literal ::= NK_VARIABLE */ - 560, /* (729) interval_sliding_duration_literal ::= NK_STRING */ - 560, /* (730) interval_sliding_duration_literal ::= NK_INTEGER */ - 553, /* (731) fill_opt ::= */ - 553, /* (732) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 553, /* (733) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 553, /* (734) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 561, /* (735) fill_mode ::= NONE */ - 561, /* (736) fill_mode ::= PREV */ - 561, /* (737) fill_mode ::= NULL */ - 561, /* (738) fill_mode ::= NULL_F */ - 561, /* (739) fill_mode ::= LINEAR */ - 561, /* (740) fill_mode ::= NEXT */ - 555, /* (741) group_by_clause_opt ::= */ - 555, /* (742) group_by_clause_opt ::= GROUP BY group_by_list */ - 562, /* (743) group_by_list ::= expr_or_subquery */ - 562, /* (744) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 556, /* (745) having_clause_opt ::= */ - 556, /* (746) having_clause_opt ::= HAVING search_condition */ - 551, /* (747) range_opt ::= */ - 551, /* (748) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 551, /* (749) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 552, /* (750) every_opt ::= */ - 552, /* (751) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 563, /* (752) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 564, /* (753) query_simple ::= query_specification */ - 564, /* (754) query_simple ::= union_query_expression */ - 568, /* (755) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 568, /* (756) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 569, /* (757) query_simple_or_subquery ::= query_simple */ - 569, /* (758) query_simple_or_subquery ::= subquery */ - 480, /* (759) query_or_subquery ::= query_expression */ - 480, /* (760) query_or_subquery ::= subquery */ - 565, /* (761) order_by_clause_opt ::= */ - 565, /* (762) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 566, /* (763) slimit_clause_opt ::= */ - 566, /* (764) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 566, /* (765) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 566, /* (766) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 567, /* (767) limit_clause_opt ::= */ - 567, /* (768) limit_clause_opt ::= LIMIT NK_INTEGER */ - 567, /* (769) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 567, /* (770) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 537, /* (771) subquery ::= NK_LP query_expression NK_RP */ - 537, /* (772) subquery ::= NK_LP subquery NK_RP */ - 410, /* (773) search_condition ::= common_expression */ - 570, /* (774) sort_specification_list ::= sort_specification */ - 570, /* (775) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 571, /* (776) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 572, /* (777) ordering_specification_opt ::= */ - 572, /* (778) ordering_specification_opt ::= ASC */ - 572, /* (779) ordering_specification_opt ::= DESC */ - 573, /* (780) null_ordering_opt ::= */ - 573, /* (781) null_ordering_opt ::= NULLS FIRST */ - 573, /* (782) null_ordering_opt ::= NULLS LAST */ - 440, /* (783) column_options ::= */ - 440, /* (784) column_options ::= column_options PRIMARY KEY */ - 440, /* (785) column_options ::= column_options NK_ID NK_STRING */ -}; - -/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number -** of symbols on the right-hand side of that rule. */ -static const signed char yyRuleInfoNRhs[] = { - -6, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - -4, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - 0, /* (2) account_options ::= */ - -3, /* (3) account_options ::= account_options PPS literal */ - -3, /* (4) account_options ::= account_options TSERIES literal */ - -3, /* (5) account_options ::= account_options STORAGE literal */ - -3, /* (6) account_options ::= account_options STREAMS literal */ - -3, /* (7) account_options ::= account_options QTIME literal */ - -3, /* (8) account_options ::= account_options DBS literal */ - -3, /* (9) account_options ::= account_options USERS literal */ - -3, /* (10) account_options ::= account_options CONNS literal */ - -3, /* (11) account_options ::= account_options STATE literal */ - -1, /* (12) alter_account_options ::= alter_account_option */ - -2, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - -2, /* (14) alter_account_option ::= PASS literal */ - -2, /* (15) alter_account_option ::= PPS literal */ - -2, /* (16) alter_account_option ::= TSERIES literal */ - -2, /* (17) alter_account_option ::= STORAGE literal */ - -2, /* (18) alter_account_option ::= STREAMS literal */ - -2, /* (19) alter_account_option ::= QTIME literal */ - -2, /* (20) alter_account_option ::= DBS literal */ - -2, /* (21) alter_account_option ::= USERS literal */ - -2, /* (22) alter_account_option ::= CONNS literal */ - -2, /* (23) alter_account_option ::= STATE literal */ - -1, /* (24) ip_range_list ::= NK_STRING */ - -3, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ - -2, /* (26) white_list ::= HOST ip_range_list */ - 0, /* (27) white_list_opt ::= */ - -1, /* (28) white_list_opt ::= white_list */ - 0, /* (29) is_import_opt ::= */ - -2, /* (30) is_import_opt ::= IS_IMPORT NK_INTEGER */ - 0, /* (31) is_createdb_opt ::= */ - -2, /* (32) is_createdb_opt ::= CREATEDB NK_INTEGER */ - -9, /* (33) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ - -5, /* (34) cmd ::= ALTER USER user_name PASS NK_STRING */ - -5, /* (35) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - -5, /* (36) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - -5, /* (37) cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ - -5, /* (38) cmd ::= ALTER USER user_name ADD white_list */ - -5, /* (39) cmd ::= ALTER USER user_name DROP white_list */ - -3, /* (40) cmd ::= DROP USER user_name */ - 0, /* (41) sysinfo_opt ::= */ - -2, /* (42) sysinfo_opt ::= SYSINFO NK_INTEGER */ - -7, /* (43) cmd ::= GRANT privileges ON priv_level with_clause_opt TO user_name */ - -7, /* (44) cmd ::= REVOKE privileges ON priv_level with_clause_opt FROM user_name */ - -1, /* (45) privileges ::= ALL */ - -1, /* (46) privileges ::= priv_type_list */ - -1, /* (47) privileges ::= SUBSCRIBE */ - -1, /* (48) priv_type_list ::= priv_type */ - -3, /* (49) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - -1, /* (50) priv_type ::= READ */ - -1, /* (51) priv_type ::= WRITE */ - -1, /* (52) priv_type ::= ALTER */ - -3, /* (53) priv_level ::= NK_STAR NK_DOT NK_STAR */ - -3, /* (54) priv_level ::= db_name NK_DOT NK_STAR */ - -3, /* (55) priv_level ::= db_name NK_DOT table_name */ - -1, /* (56) priv_level ::= topic_name */ - 0, /* (57) with_clause_opt ::= */ - -2, /* (58) with_clause_opt ::= WITH search_condition */ - -3, /* (59) cmd ::= CREATE ENCRYPT_KEY NK_STRING */ - -3, /* (60) cmd ::= CREATE ANODE NK_STRING */ - -3, /* (61) cmd ::= UPDATE ANODE NK_INTEGER */ - -3, /* (62) cmd ::= UPDATE ALL ANODES */ - -3, /* (63) cmd ::= DROP ANODE NK_INTEGER */ - -3, /* (64) cmd ::= CREATE DNODE dnode_endpoint */ - -5, /* (65) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - -4, /* (66) cmd ::= DROP DNODE NK_INTEGER force_opt */ - -4, /* (67) cmd ::= DROP DNODE dnode_endpoint force_opt */ - -4, /* (68) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - -4, /* (69) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - -4, /* (70) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - -5, /* (71) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - -4, /* (72) cmd ::= ALTER ALL DNODES NK_STRING */ - -5, /* (73) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - -3, /* (74) cmd ::= RESTORE DNODE NK_INTEGER */ - -1, /* (75) dnode_endpoint ::= NK_STRING */ - -1, /* (76) dnode_endpoint ::= NK_ID */ - -1, /* (77) dnode_endpoint ::= NK_IPTOKEN */ - 0, /* (78) force_opt ::= */ - -1, /* (79) force_opt ::= FORCE */ - -1, /* (80) unsafe_opt ::= UNSAFE */ - -3, /* (81) cmd ::= ALTER CLUSTER NK_STRING */ - -4, /* (82) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ - -3, /* (83) cmd ::= ALTER LOCAL NK_STRING */ - -4, /* (84) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - -5, /* (85) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - -5, /* (86) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - -5, /* (87) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - -5, /* (88) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - -5, /* (89) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - -5, /* (90) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - -5, /* (91) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - -5, /* (92) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - -5, /* (93) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - -5, /* (94) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - -5, /* (95) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - -5, /* (96) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - -4, /* (97) cmd ::= DROP DATABASE exists_opt db_name */ - -2, /* (98) cmd ::= USE db_name */ - -4, /* (99) cmd ::= ALTER DATABASE db_name alter_db_options */ - -3, /* (100) cmd ::= FLUSH DATABASE db_name */ - -4, /* (101) cmd ::= TRIM DATABASE db_name speed_opt */ - -3, /* (102) cmd ::= S3MIGRATE DATABASE db_name */ - -5, /* (103) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - -3, /* (104) not_exists_opt ::= IF NOT EXISTS */ - 0, /* (105) not_exists_opt ::= */ - -2, /* (106) exists_opt ::= IF EXISTS */ - 0, /* (107) exists_opt ::= */ - 0, /* (108) db_options ::= */ - -3, /* (109) db_options ::= db_options BUFFER NK_INTEGER */ - -3, /* (110) db_options ::= db_options CACHEMODEL NK_STRING */ - -3, /* (111) db_options ::= db_options CACHESIZE NK_INTEGER */ - -3, /* (112) db_options ::= db_options COMP NK_INTEGER */ - -3, /* (113) db_options ::= db_options DURATION NK_INTEGER */ - -3, /* (114) db_options ::= db_options DURATION NK_VARIABLE */ - -3, /* (115) db_options ::= db_options MAXROWS NK_INTEGER */ - -3, /* (116) db_options ::= db_options MINROWS NK_INTEGER */ - -3, /* (117) db_options ::= db_options KEEP integer_list */ - -3, /* (118) db_options ::= db_options KEEP variable_list */ - -3, /* (119) db_options ::= db_options PAGES NK_INTEGER */ - -3, /* (120) db_options ::= db_options PAGESIZE NK_INTEGER */ - -3, /* (121) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - -3, /* (122) db_options ::= db_options PRECISION NK_STRING */ - -3, /* (123) db_options ::= db_options REPLICA NK_INTEGER */ - -3, /* (124) db_options ::= db_options VGROUPS NK_INTEGER */ - -3, /* (125) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - -3, /* (126) db_options ::= db_options RETENTIONS retention_list */ - -3, /* (127) db_options ::= db_options SCHEMALESS NK_INTEGER */ - -3, /* (128) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - -3, /* (129) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - -3, /* (130) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - -4, /* (131) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - -3, /* (132) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - -4, /* (133) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - -3, /* (134) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - -3, /* (135) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - -3, /* (136) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - -3, /* (137) db_options ::= db_options TABLE_PREFIX signed */ - -3, /* (138) db_options ::= db_options TABLE_SUFFIX signed */ - -3, /* (139) db_options ::= db_options S3_CHUNKPAGES NK_INTEGER */ - -3, /* (140) db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ - -3, /* (141) db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ - -3, /* (142) db_options ::= db_options S3_COMPACT NK_INTEGER */ - -3, /* (143) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ - -3, /* (144) db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ - -3, /* (145) db_options ::= db_options DNODES NK_STRING */ - -1, /* (146) alter_db_options ::= alter_db_option */ - -2, /* (147) alter_db_options ::= alter_db_options alter_db_option */ - -2, /* (148) alter_db_option ::= BUFFER NK_INTEGER */ - -2, /* (149) alter_db_option ::= CACHEMODEL NK_STRING */ - -2, /* (150) alter_db_option ::= CACHESIZE NK_INTEGER */ - -2, /* (151) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - -2, /* (152) alter_db_option ::= KEEP integer_list */ - -2, /* (153) alter_db_option ::= KEEP variable_list */ - -2, /* (154) alter_db_option ::= PAGES NK_INTEGER */ - -2, /* (155) alter_db_option ::= REPLICA NK_INTEGER */ - -2, /* (156) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - -2, /* (157) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - -2, /* (158) alter_db_option ::= MINROWS NK_INTEGER */ - -2, /* (159) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - -3, /* (160) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - -2, /* (161) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - -3, /* (162) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - -2, /* (163) alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ - -2, /* (164) alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ - -2, /* (165) alter_db_option ::= S3_COMPACT NK_INTEGER */ - -2, /* (166) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ - -2, /* (167) alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ - -1, /* (168) integer_list ::= NK_INTEGER */ - -3, /* (169) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - -1, /* (170) variable_list ::= NK_VARIABLE */ - -3, /* (171) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - -1, /* (172) retention_list ::= retention */ - -3, /* (173) retention_list ::= retention_list NK_COMMA retention */ - -3, /* (174) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - -3, /* (175) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ - 0, /* (176) speed_opt ::= */ - -2, /* (177) speed_opt ::= BWLIMIT NK_INTEGER */ - 0, /* (178) start_opt ::= */ - -3, /* (179) start_opt ::= START WITH NK_INTEGER */ - -3, /* (180) start_opt ::= START WITH NK_STRING */ - -4, /* (181) start_opt ::= START WITH TIMESTAMP NK_STRING */ - 0, /* (182) end_opt ::= */ - -3, /* (183) end_opt ::= END WITH NK_INTEGER */ - -3, /* (184) end_opt ::= END WITH NK_STRING */ - -4, /* (185) end_opt ::= END WITH TIMESTAMP NK_STRING */ - -9, /* (186) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - -3, /* (187) cmd ::= CREATE TABLE multi_create_clause */ - -10, /* (188) cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ - -9, /* (189) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - -4, /* (190) cmd ::= DROP TABLE with_opt multi_drop_clause */ - -5, /* (191) cmd ::= DROP STABLE with_opt exists_opt full_table_name */ - -3, /* (192) cmd ::= ALTER TABLE alter_table_clause */ - -3, /* (193) cmd ::= ALTER STABLE alter_table_clause */ - -2, /* (194) alter_table_clause ::= full_table_name alter_table_options */ - -6, /* (195) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ - -4, /* (196) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - -5, /* (197) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - -5, /* (198) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ - -5, /* (199) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - -5, /* (200) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - -4, /* (201) alter_table_clause ::= full_table_name DROP TAG column_name */ - -5, /* (202) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - -5, /* (203) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - -6, /* (204) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ - -1, /* (205) multi_create_clause ::= create_subtable_clause */ - -2, /* (206) multi_create_clause ::= multi_create_clause create_subtable_clause */ - -10, /* (207) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ - -1, /* (208) multi_drop_clause ::= drop_table_clause */ - -3, /* (209) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - -2, /* (210) drop_table_clause ::= exists_opt full_table_name */ - 0, /* (211) with_opt ::= */ - -1, /* (212) with_opt ::= WITH */ - 0, /* (213) specific_cols_opt ::= */ - -3, /* (214) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - -1, /* (215) full_table_name ::= table_name */ - -3, /* (216) full_table_name ::= db_name NK_DOT table_name */ - -1, /* (217) tag_def_list ::= tag_def */ - -3, /* (218) tag_def_list ::= tag_def_list NK_COMMA tag_def */ - -2, /* (219) tag_def ::= column_name type_name */ - -1, /* (220) column_def_list ::= column_def */ - -3, /* (221) column_def_list ::= column_def_list NK_COMMA column_def */ - -3, /* (222) column_def ::= column_name type_name column_options */ - -1, /* (223) type_name ::= BOOL */ - -1, /* (224) type_name ::= TINYINT */ - -1, /* (225) type_name ::= SMALLINT */ - -1, /* (226) type_name ::= INT */ - -1, /* (227) type_name ::= INTEGER */ - -1, /* (228) type_name ::= BIGINT */ - -1, /* (229) type_name ::= FLOAT */ - -1, /* (230) type_name ::= DOUBLE */ - -4, /* (231) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - -1, /* (232) type_name ::= TIMESTAMP */ - -4, /* (233) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - -2, /* (234) type_name ::= TINYINT UNSIGNED */ - -2, /* (235) type_name ::= SMALLINT UNSIGNED */ - -2, /* (236) type_name ::= INT UNSIGNED */ - -2, /* (237) type_name ::= BIGINT UNSIGNED */ - -1, /* (238) type_name ::= JSON */ - -4, /* (239) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - -1, /* (240) type_name ::= MEDIUMBLOB */ - -1, /* (241) type_name ::= BLOB */ - -4, /* (242) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - -4, /* (243) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - -1, /* (244) type_name ::= DECIMAL */ - -4, /* (245) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - -6, /* (246) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - -1, /* (247) type_name_default_len ::= BINARY */ - -1, /* (248) type_name_default_len ::= NCHAR */ - -1, /* (249) type_name_default_len ::= VARCHAR */ - -1, /* (250) type_name_default_len ::= VARBINARY */ - 0, /* (251) tags_def_opt ::= */ - -1, /* (252) tags_def_opt ::= tags_def */ - -4, /* (253) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ - 0, /* (254) table_options ::= */ - -3, /* (255) table_options ::= table_options COMMENT NK_STRING */ - -3, /* (256) table_options ::= table_options MAX_DELAY duration_list */ - -3, /* (257) table_options ::= table_options WATERMARK duration_list */ - -5, /* (258) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - -3, /* (259) table_options ::= table_options TTL NK_INTEGER */ - -5, /* (260) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - -3, /* (261) table_options ::= table_options DELETE_MARK duration_list */ - -1, /* (262) alter_table_options ::= alter_table_option */ - -2, /* (263) alter_table_options ::= alter_table_options alter_table_option */ - -2, /* (264) alter_table_option ::= COMMENT NK_STRING */ - -2, /* (265) alter_table_option ::= TTL NK_INTEGER */ - -1, /* (266) duration_list ::= duration_literal */ - -3, /* (267) duration_list ::= duration_list NK_COMMA duration_literal */ - -1, /* (268) rollup_func_list ::= rollup_func_name */ - -3, /* (269) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - -1, /* (270) rollup_func_name ::= function_name */ - -1, /* (271) rollup_func_name ::= FIRST */ - -1, /* (272) rollup_func_name ::= LAST */ - -1, /* (273) col_name_list ::= col_name */ - -3, /* (274) col_name_list ::= col_name_list NK_COMMA col_name */ - -1, /* (275) col_name ::= column_name */ - -2, /* (276) cmd ::= SHOW DNODES */ - -2, /* (277) cmd ::= SHOW USERS */ - -3, /* (278) cmd ::= SHOW USERS FULL */ - -3, /* (279) cmd ::= SHOW USER PRIVILEGES */ - -3, /* (280) cmd ::= SHOW db_kind_opt DATABASES */ - -4, /* (281) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - -4, /* (282) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - -3, /* (283) cmd ::= SHOW db_name_cond_opt VGROUPS */ - -2, /* (284) cmd ::= SHOW MNODES */ - -2, /* (285) cmd ::= SHOW QNODES */ - -2, /* (286) cmd ::= SHOW ANODES */ - -3, /* (287) cmd ::= SHOW ANODES FULL */ - -2, /* (288) cmd ::= SHOW ARBGROUPS */ - -2, /* (289) cmd ::= SHOW FUNCTIONS */ - -5, /* (290) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - -6, /* (291) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - -2, /* (292) cmd ::= SHOW STREAMS */ - -2, /* (293) cmd ::= SHOW ACCOUNTS */ - -2, /* (294) cmd ::= SHOW APPS */ - -2, /* (295) cmd ::= SHOW CONNECTIONS */ - -2, /* (296) cmd ::= SHOW LICENCES */ - -2, /* (297) cmd ::= SHOW GRANTS */ - -3, /* (298) cmd ::= SHOW GRANTS FULL */ - -3, /* (299) cmd ::= SHOW GRANTS LOGS */ - -3, /* (300) cmd ::= SHOW CLUSTER MACHINES */ - -4, /* (301) cmd ::= SHOW CREATE DATABASE db_name */ - -4, /* (302) cmd ::= SHOW CREATE TABLE full_table_name */ - -4, /* (303) cmd ::= SHOW CREATE STABLE full_table_name */ - -2, /* (304) cmd ::= SHOW ENCRYPTIONS */ - -2, /* (305) cmd ::= SHOW QUERIES */ - -2, /* (306) cmd ::= SHOW SCORES */ - -2, /* (307) cmd ::= SHOW TOPICS */ - -2, /* (308) cmd ::= SHOW VARIABLES */ - -3, /* (309) cmd ::= SHOW CLUSTER VARIABLES */ - -3, /* (310) cmd ::= SHOW LOCAL VARIABLES */ - -5, /* (311) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - -2, /* (312) cmd ::= SHOW BNODES */ - -2, /* (313) cmd ::= SHOW SNODES */ - -2, /* (314) cmd ::= SHOW CLUSTER */ - -2, /* (315) cmd ::= SHOW TRANSACTIONS */ - -4, /* (316) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - -2, /* (317) cmd ::= SHOW CONSUMERS */ - -2, /* (318) cmd ::= SHOW SUBSCRIPTIONS */ - -5, /* (319) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - -6, /* (320) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - -7, /* (321) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - -8, /* (322) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - -5, /* (323) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - -2, /* (324) cmd ::= SHOW VNODES */ - -3, /* (325) cmd ::= SHOW db_name_cond_opt ALIVE */ - -3, /* (326) cmd ::= SHOW CLUSTER ALIVE */ - -4, /* (327) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - -4, /* (328) cmd ::= SHOW CREATE VIEW full_table_name */ - -2, /* (329) cmd ::= SHOW COMPACTS */ - -3, /* (330) cmd ::= SHOW COMPACT NK_INTEGER */ - 0, /* (331) table_kind_db_name_cond_opt ::= */ - -1, /* (332) table_kind_db_name_cond_opt ::= table_kind */ - -2, /* (333) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - -3, /* (334) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - -1, /* (335) table_kind ::= NORMAL */ - -1, /* (336) table_kind ::= CHILD */ - 0, /* (337) db_name_cond_opt ::= */ - -2, /* (338) db_name_cond_opt ::= db_name NK_DOT */ - 0, /* (339) like_pattern_opt ::= */ - -2, /* (340) like_pattern_opt ::= LIKE NK_STRING */ - -1, /* (341) table_name_cond ::= table_name */ - 0, /* (342) from_db_opt ::= */ - -2, /* (343) from_db_opt ::= FROM db_name */ - 0, /* (344) tag_list_opt ::= */ - -1, /* (345) tag_list_opt ::= tag_item */ - -3, /* (346) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - -1, /* (347) tag_item ::= TBNAME */ - -1, /* (348) tag_item ::= QTAGS */ - -1, /* (349) tag_item ::= column_name */ - -2, /* (350) tag_item ::= column_name column_alias */ - -3, /* (351) tag_item ::= column_name AS column_alias */ - 0, /* (352) db_kind_opt ::= */ - -1, /* (353) db_kind_opt ::= USER */ - -1, /* (354) db_kind_opt ::= SYSTEM */ - -11, /* (355) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ - -11, /* (356) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ - -4, /* (357) cmd ::= DROP TSMA exists_opt full_tsma_name */ - -3, /* (358) cmd ::= SHOW db_name_cond_opt TSMAS */ - -1, /* (359) full_tsma_name ::= tsma_name */ - -3, /* (360) full_tsma_name ::= db_name NK_DOT tsma_name */ - -4, /* (361) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ - -8, /* (362) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - -9, /* (363) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - -4, /* (364) cmd ::= DROP INDEX exists_opt full_index_name */ - -1, /* (365) full_index_name ::= index_name */ - -3, /* (366) full_index_name ::= db_name NK_DOT index_name */ - -10, /* (367) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - -12, /* (368) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - -1, /* (369) func_list ::= func */ - -3, /* (370) func_list ::= func_list NK_COMMA func */ - -4, /* (371) func ::= sma_func_name NK_LP expression_list NK_RP */ - -1, /* (372) sma_func_name ::= function_name */ - -1, /* (373) sma_func_name ::= COUNT */ - -1, /* (374) sma_func_name ::= FIRST */ - -1, /* (375) sma_func_name ::= LAST */ - -1, /* (376) sma_func_name ::= LAST_ROW */ - 0, /* (377) sma_stream_opt ::= */ - -3, /* (378) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - -3, /* (379) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - -3, /* (380) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - -1, /* (381) with_meta ::= AS */ - -3, /* (382) with_meta ::= WITH META AS */ - -3, /* (383) with_meta ::= ONLY META AS */ - -6, /* (384) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - -7, /* (385) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - -8, /* (386) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - -4, /* (387) cmd ::= DROP TOPIC exists_opt topic_name */ - -7, /* (388) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - -2, /* (389) cmd ::= DESC full_table_name */ - -2, /* (390) cmd ::= DESCRIBE full_table_name */ - -3, /* (391) cmd ::= RESET QUERY CACHE */ - -4, /* (392) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - -4, /* (393) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 0, /* (394) analyze_opt ::= */ - -1, /* (395) analyze_opt ::= ANALYZE */ - 0, /* (396) explain_options ::= */ - -3, /* (397) explain_options ::= explain_options VERBOSE NK_BOOL */ - -3, /* (398) explain_options ::= explain_options RATIO NK_FLOAT */ - -12, /* (399) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - -4, /* (400) cmd ::= DROP FUNCTION exists_opt function_name */ - 0, /* (401) agg_func_opt ::= */ - -1, /* (402) agg_func_opt ::= AGGREGATE */ - 0, /* (403) bufsize_opt ::= */ - -2, /* (404) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 0, /* (405) language_opt ::= */ - -2, /* (406) language_opt ::= LANGUAGE NK_STRING */ - 0, /* (407) or_replace_opt ::= */ - -2, /* (408) or_replace_opt ::= OR REPLACE */ - -6, /* (409) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - -4, /* (410) cmd ::= DROP VIEW exists_opt full_view_name */ - -1, /* (411) full_view_name ::= view_name */ - -3, /* (412) full_view_name ::= db_name NK_DOT view_name */ - -12, /* (413) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - -4, /* (414) cmd ::= DROP STREAM exists_opt stream_name */ - -4, /* (415) cmd ::= PAUSE STREAM exists_opt stream_name */ - -5, /* (416) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 0, /* (417) col_list_opt ::= */ - -3, /* (418) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ - -1, /* (419) column_stream_def_list ::= column_stream_def */ - -3, /* (420) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ - -2, /* (421) column_stream_def ::= column_name stream_col_options */ - 0, /* (422) stream_col_options ::= */ - -3, /* (423) stream_col_options ::= stream_col_options PRIMARY KEY */ - 0, /* (424) tag_def_or_ref_opt ::= */ - -1, /* (425) tag_def_or_ref_opt ::= tags_def */ - -4, /* (426) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ - 0, /* (427) stream_options ::= */ - -3, /* (428) stream_options ::= stream_options TRIGGER AT_ONCE */ - -3, /* (429) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - -3, /* (430) stream_options ::= stream_options TRIGGER FORCE_WINDOW_CLOSE */ - -4, /* (431) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - -3, /* (432) stream_options ::= stream_options WATERMARK duration_literal */ - -4, /* (433) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - -3, /* (434) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - -3, /* (435) stream_options ::= stream_options DELETE_MARK duration_literal */ - -4, /* (436) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 0, /* (437) subtable_opt ::= */ - -4, /* (438) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 0, /* (439) ignore_opt ::= */ - -2, /* (440) ignore_opt ::= IGNORE UNTREATED */ - -3, /* (441) cmd ::= KILL CONNECTION NK_INTEGER */ - -3, /* (442) cmd ::= KILL QUERY NK_STRING */ - -3, /* (443) cmd ::= KILL TRANSACTION NK_INTEGER */ - -3, /* (444) cmd ::= KILL COMPACT NK_INTEGER */ - -2, /* (445) cmd ::= BALANCE VGROUP */ - -4, /* (446) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - -5, /* (447) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ - -4, /* (448) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - -4, /* (449) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - -3, /* (450) cmd ::= SPLIT VGROUP NK_INTEGER */ - 0, /* (451) on_vgroup_id ::= */ - -2, /* (452) on_vgroup_id ::= ON NK_INTEGER */ - -2, /* (453) dnode_list ::= DNODE NK_INTEGER */ - -3, /* (454) dnode_list ::= dnode_list DNODE NK_INTEGER */ - -4, /* (455) cmd ::= DELETE FROM full_table_name where_clause_opt */ - -1, /* (456) cmd ::= query_or_subquery */ - -1, /* (457) cmd ::= insert_query */ - -7, /* (458) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - -4, /* (459) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - -1, /* (460) tags_literal ::= NK_INTEGER */ - -3, /* (461) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - -3, /* (462) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ - -2, /* (463) tags_literal ::= NK_PLUS NK_INTEGER */ - -4, /* (464) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - -4, /* (465) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ - -2, /* (466) tags_literal ::= NK_MINUS NK_INTEGER */ - -4, /* (467) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ - -4, /* (468) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ - -1, /* (469) tags_literal ::= NK_FLOAT */ - -2, /* (470) tags_literal ::= NK_PLUS NK_FLOAT */ - -2, /* (471) tags_literal ::= NK_MINUS NK_FLOAT */ - -1, /* (472) tags_literal ::= NK_BIN */ - -3, /* (473) tags_literal ::= NK_BIN NK_PLUS duration_literal */ - -3, /* (474) tags_literal ::= NK_BIN NK_MINUS duration_literal */ - -2, /* (475) tags_literal ::= NK_PLUS NK_BIN */ - -4, /* (476) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ - -4, /* (477) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ - -2, /* (478) tags_literal ::= NK_MINUS NK_BIN */ - -4, /* (479) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ - -4, /* (480) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ - -1, /* (481) tags_literal ::= NK_HEX */ - -3, /* (482) tags_literal ::= NK_HEX NK_PLUS duration_literal */ - -3, /* (483) tags_literal ::= NK_HEX NK_MINUS duration_literal */ - -2, /* (484) tags_literal ::= NK_PLUS NK_HEX */ - -4, /* (485) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ - -4, /* (486) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ - -2, /* (487) tags_literal ::= NK_MINUS NK_HEX */ - -4, /* (488) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ - -4, /* (489) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ - -1, /* (490) tags_literal ::= NK_STRING */ - -3, /* (491) tags_literal ::= NK_STRING NK_PLUS duration_literal */ - -3, /* (492) tags_literal ::= NK_STRING NK_MINUS duration_literal */ - -1, /* (493) tags_literal ::= NK_BOOL */ - -1, /* (494) tags_literal ::= NULL */ - -1, /* (495) tags_literal ::= literal_func */ - -3, /* (496) tags_literal ::= literal_func NK_PLUS duration_literal */ - -3, /* (497) tags_literal ::= literal_func NK_MINUS duration_literal */ - -1, /* (498) tags_literal_list ::= tags_literal */ - -3, /* (499) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - -1, /* (500) literal ::= NK_INTEGER */ - -1, /* (501) literal ::= NK_FLOAT */ - -1, /* (502) literal ::= NK_STRING */ - -1, /* (503) literal ::= NK_BOOL */ - -2, /* (504) literal ::= TIMESTAMP NK_STRING */ - -1, /* (505) literal ::= duration_literal */ - -1, /* (506) literal ::= NULL */ - -1, /* (507) literal ::= NK_QUESTION */ - -1, /* (508) duration_literal ::= NK_VARIABLE */ - -1, /* (509) signed ::= NK_INTEGER */ - -2, /* (510) signed ::= NK_PLUS NK_INTEGER */ - -2, /* (511) signed ::= NK_MINUS NK_INTEGER */ - -1, /* (512) signed ::= NK_FLOAT */ - -2, /* (513) signed ::= NK_PLUS NK_FLOAT */ - -2, /* (514) signed ::= NK_MINUS NK_FLOAT */ - -1, /* (515) signed_literal ::= signed */ - -1, /* (516) signed_literal ::= NK_STRING */ - -1, /* (517) signed_literal ::= NK_BOOL */ - -2, /* (518) signed_literal ::= TIMESTAMP NK_STRING */ - -1, /* (519) signed_literal ::= duration_literal */ - -1, /* (520) signed_literal ::= NULL */ - -1, /* (521) signed_literal ::= literal_func */ - -1, /* (522) signed_literal ::= NK_QUESTION */ - -1, /* (523) literal_list ::= signed_literal */ - -3, /* (524) literal_list ::= literal_list NK_COMMA signed_literal */ - -1, /* (525) db_name ::= NK_ID */ - -1, /* (526) table_name ::= NK_ID */ - -1, /* (527) column_name ::= NK_ID */ - -1, /* (528) function_name ::= NK_ID */ - -1, /* (529) view_name ::= NK_ID */ - -1, /* (530) table_alias ::= NK_ID */ - -1, /* (531) column_alias ::= NK_ID */ - -1, /* (532) column_alias ::= NK_ALIAS */ - -1, /* (533) user_name ::= NK_ID */ - -1, /* (534) topic_name ::= NK_ID */ - -1, /* (535) stream_name ::= NK_ID */ - -1, /* (536) cgroup_name ::= NK_ID */ - -1, /* (537) index_name ::= NK_ID */ - -1, /* (538) tsma_name ::= NK_ID */ - -1, /* (539) expr_or_subquery ::= expression */ - -1, /* (540) expression ::= literal */ - -1, /* (541) expression ::= pseudo_column */ - -1, /* (542) expression ::= column_reference */ - -1, /* (543) expression ::= function_expression */ - -1, /* (544) expression ::= case_when_expression */ - -3, /* (545) expression ::= NK_LP expression NK_RP */ - -2, /* (546) expression ::= NK_PLUS expr_or_subquery */ - -2, /* (547) expression ::= NK_MINUS expr_or_subquery */ - -3, /* (548) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - -3, /* (549) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - -3, /* (550) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - -3, /* (551) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - -3, /* (552) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - -3, /* (553) expression ::= column_reference NK_ARROW NK_STRING */ - -3, /* (554) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - -3, /* (555) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - -1, /* (556) expression_list ::= expr_or_subquery */ - -3, /* (557) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - -1, /* (558) column_reference ::= column_name */ - -3, /* (559) column_reference ::= table_name NK_DOT column_name */ - -1, /* (560) column_reference ::= NK_ALIAS */ - -3, /* (561) column_reference ::= table_name NK_DOT NK_ALIAS */ - -1, /* (562) pseudo_column ::= ROWTS */ - -1, /* (563) pseudo_column ::= TBNAME */ - -3, /* (564) pseudo_column ::= table_name NK_DOT TBNAME */ - -1, /* (565) pseudo_column ::= QSTART */ - -1, /* (566) pseudo_column ::= QEND */ - -1, /* (567) pseudo_column ::= QDURATION */ - -1, /* (568) pseudo_column ::= WSTART */ - -1, /* (569) pseudo_column ::= WEND */ - -1, /* (570) pseudo_column ::= WDURATION */ - -1, /* (571) pseudo_column ::= IROWTS */ - -1, /* (572) pseudo_column ::= ISFILLED */ - -1, /* (573) pseudo_column ::= QTAGS */ - -1, /* (574) pseudo_column ::= FLOW */ - -1, /* (575) pseudo_column ::= FHIGH */ - -1, /* (576) pseudo_column ::= FROWTS */ - -4, /* (577) function_expression ::= function_name NK_LP expression_list NK_RP */ - -4, /* (578) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - -6, /* (579) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - -6, /* (580) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ - -6, /* (581) function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP */ - -4, /* (582) function_expression ::= TRIM NK_LP expr_or_subquery NK_RP */ - -6, /* (583) function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP */ - -6, /* (584) function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ - -7, /* (585) function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP */ - -4, /* (586) function_expression ::= substr_func NK_LP expression_list NK_RP */ - -6, /* (587) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ - -8, /* (588) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP */ - -4, /* (589) function_expression ::= REPLACE NK_LP expression_list NK_RP */ - -1, /* (590) function_expression ::= literal_func */ - -1, /* (591) function_expression ::= rand_func */ - -3, /* (592) literal_func ::= noarg_func NK_LP NK_RP */ - -1, /* (593) literal_func ::= NOW */ - -1, /* (594) literal_func ::= TODAY */ - -3, /* (595) rand_func ::= RAND NK_LP NK_RP */ - -4, /* (596) rand_func ::= RAND NK_LP expression_list NK_RP */ - -1, /* (597) substr_func ::= SUBSTR */ - -1, /* (598) substr_func ::= SUBSTRING */ - -1, /* (599) trim_specification_type ::= BOTH */ - -1, /* (600) trim_specification_type ::= TRAILING */ - -1, /* (601) trim_specification_type ::= LEADING */ - -1, /* (602) noarg_func ::= NOW */ - -1, /* (603) noarg_func ::= TODAY */ - -1, /* (604) noarg_func ::= TIMEZONE */ - -1, /* (605) noarg_func ::= DATABASE */ - -1, /* (606) noarg_func ::= CLIENT_VERSION */ - -1, /* (607) noarg_func ::= SERVER_VERSION */ - -1, /* (608) noarg_func ::= SERVER_STATUS */ - -1, /* (609) noarg_func ::= CURRENT_USER */ - -1, /* (610) noarg_func ::= USER */ - -1, /* (611) noarg_func ::= PI */ - -1, /* (612) star_func ::= COUNT */ - -1, /* (613) star_func ::= FIRST */ - -1, /* (614) star_func ::= LAST */ - -1, /* (615) star_func ::= LAST_ROW */ - -1, /* (616) star_func_para_list ::= NK_STAR */ - -1, /* (617) star_func_para_list ::= other_para_list */ - -1, /* (618) other_para_list ::= star_func_para */ - -3, /* (619) other_para_list ::= other_para_list NK_COMMA star_func_para */ - -1, /* (620) star_func_para ::= expr_or_subquery */ - -3, /* (621) star_func_para ::= table_name NK_DOT NK_STAR */ - -4, /* (622) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - -5, /* (623) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - -1, /* (624) when_then_list ::= when_then_expr */ - -2, /* (625) when_then_list ::= when_then_list when_then_expr */ - -4, /* (626) when_then_expr ::= WHEN common_expression THEN common_expression */ - 0, /* (627) case_when_else_opt ::= */ - -2, /* (628) case_when_else_opt ::= ELSE common_expression */ - -3, /* (629) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - -5, /* (630) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - -6, /* (631) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - -3, /* (632) predicate ::= expr_or_subquery IS NULL */ - -4, /* (633) predicate ::= expr_or_subquery IS NOT NULL */ - -3, /* (634) predicate ::= expr_or_subquery in_op in_predicate_value */ - -1, /* (635) compare_op ::= NK_LT */ - -1, /* (636) compare_op ::= NK_GT */ - -1, /* (637) compare_op ::= NK_LE */ - -1, /* (638) compare_op ::= NK_GE */ - -1, /* (639) compare_op ::= NK_NE */ - -1, /* (640) compare_op ::= NK_EQ */ - -1, /* (641) compare_op ::= LIKE */ - -2, /* (642) compare_op ::= NOT LIKE */ - -1, /* (643) compare_op ::= MATCH */ - -1, /* (644) compare_op ::= NMATCH */ - -1, /* (645) compare_op ::= CONTAINS */ - -1, /* (646) in_op ::= IN */ - -2, /* (647) in_op ::= NOT IN */ - -3, /* (648) in_predicate_value ::= NK_LP literal_list NK_RP */ - -1, /* (649) boolean_value_expression ::= boolean_primary */ - -2, /* (650) boolean_value_expression ::= NOT boolean_primary */ - -3, /* (651) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - -3, /* (652) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - -1, /* (653) boolean_primary ::= predicate */ - -3, /* (654) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - -1, /* (655) common_expression ::= expr_or_subquery */ - -1, /* (656) common_expression ::= boolean_value_expression */ - 0, /* (657) from_clause_opt ::= */ - -2, /* (658) from_clause_opt ::= FROM table_reference_list */ - -1, /* (659) table_reference_list ::= table_reference */ - -3, /* (660) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - -1, /* (661) table_reference ::= table_primary */ - -1, /* (662) table_reference ::= joined_table */ - -2, /* (663) table_primary ::= table_name alias_opt */ - -4, /* (664) table_primary ::= db_name NK_DOT table_name alias_opt */ - -2, /* (665) table_primary ::= subquery alias_opt */ - -1, /* (666) table_primary ::= parenthesized_joined_table */ - 0, /* (667) alias_opt ::= */ - -1, /* (668) alias_opt ::= table_alias */ - -2, /* (669) alias_opt ::= AS table_alias */ - -3, /* (670) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - -3, /* (671) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - -8, /* (672) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ - 0, /* (673) join_type ::= */ - -1, /* (674) join_type ::= INNER */ - -1, /* (675) join_type ::= LEFT */ - -1, /* (676) join_type ::= RIGHT */ - -1, /* (677) join_type ::= FULL */ - 0, /* (678) join_subtype ::= */ - -1, /* (679) join_subtype ::= OUTER */ - -1, /* (680) join_subtype ::= SEMI */ - -1, /* (681) join_subtype ::= ANTI */ - -1, /* (682) join_subtype ::= ASOF */ - -1, /* (683) join_subtype ::= WINDOW */ - 0, /* (684) join_on_clause_opt ::= */ - -2, /* (685) join_on_clause_opt ::= ON search_condition */ - 0, /* (686) window_offset_clause_opt ::= */ - -6, /* (687) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ - -1, /* (688) window_offset_literal ::= NK_VARIABLE */ - -2, /* (689) window_offset_literal ::= NK_MINUS NK_VARIABLE */ - 0, /* (690) jlimit_clause_opt ::= */ - -2, /* (691) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - -14, /* (692) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 0, /* (693) hint_list ::= */ - -1, /* (694) hint_list ::= NK_HINT */ - 0, /* (695) tag_mode_opt ::= */ - -1, /* (696) tag_mode_opt ::= TAGS */ - 0, /* (697) set_quantifier_opt ::= */ - -1, /* (698) set_quantifier_opt ::= DISTINCT */ - -1, /* (699) set_quantifier_opt ::= ALL */ - -1, /* (700) select_list ::= select_item */ - -3, /* (701) select_list ::= select_list NK_COMMA select_item */ - -1, /* (702) select_item ::= NK_STAR */ - -1, /* (703) select_item ::= common_expression */ - -2, /* (704) select_item ::= common_expression column_alias */ - -3, /* (705) select_item ::= common_expression AS column_alias */ - -3, /* (706) select_item ::= table_name NK_DOT NK_STAR */ - 0, /* (707) where_clause_opt ::= */ - -2, /* (708) where_clause_opt ::= WHERE search_condition */ - 0, /* (709) partition_by_clause_opt ::= */ - -3, /* (710) partition_by_clause_opt ::= PARTITION BY partition_list */ - -1, /* (711) partition_list ::= partition_item */ - -3, /* (712) partition_list ::= partition_list NK_COMMA partition_item */ - -1, /* (713) partition_item ::= expr_or_subquery */ - -2, /* (714) partition_item ::= expr_or_subquery column_alias */ - -3, /* (715) partition_item ::= expr_or_subquery AS column_alias */ - 0, /* (716) twindow_clause_opt ::= */ - -6, /* (717) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - -4, /* (718) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (719) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -8, /* (720) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -7, /* (721) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - -4, /* (722) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - -6, /* (723) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - -4, /* (724) twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (725) twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_COMMA NK_STRING NK_RP */ - 0, /* (726) sliding_opt ::= */ - -4, /* (727) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - -1, /* (728) interval_sliding_duration_literal ::= NK_VARIABLE */ - -1, /* (729) interval_sliding_duration_literal ::= NK_STRING */ - -1, /* (730) interval_sliding_duration_literal ::= NK_INTEGER */ - 0, /* (731) fill_opt ::= */ - -4, /* (732) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (733) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (734) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (735) fill_mode ::= NONE */ - -1, /* (736) fill_mode ::= PREV */ - -1, /* (737) fill_mode ::= NULL */ - -1, /* (738) fill_mode ::= NULL_F */ - -1, /* (739) fill_mode ::= LINEAR */ - -1, /* (740) fill_mode ::= NEXT */ - 0, /* (741) group_by_clause_opt ::= */ - -3, /* (742) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (743) group_by_list ::= expr_or_subquery */ - -3, /* (744) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (745) having_clause_opt ::= */ - -2, /* (746) having_clause_opt ::= HAVING search_condition */ - 0, /* (747) range_opt ::= */ - -6, /* (748) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - -4, /* (749) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 0, /* (750) every_opt ::= */ - -4, /* (751) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (752) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (753) query_simple ::= query_specification */ - -1, /* (754) query_simple ::= union_query_expression */ - -4, /* (755) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (756) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (757) query_simple_or_subquery ::= query_simple */ - -1, /* (758) query_simple_or_subquery ::= subquery */ - -1, /* (759) query_or_subquery ::= query_expression */ - -1, /* (760) query_or_subquery ::= subquery */ - 0, /* (761) order_by_clause_opt ::= */ - -3, /* (762) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (763) slimit_clause_opt ::= */ - -2, /* (764) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (765) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (766) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (767) limit_clause_opt ::= */ - -2, /* (768) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (769) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (770) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (771) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (772) subquery ::= NK_LP subquery NK_RP */ - -1, /* (773) search_condition ::= common_expression */ - -1, /* (774) sort_specification_list ::= sort_specification */ - -3, /* (775) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (776) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (777) ordering_specification_opt ::= */ - -1, /* (778) ordering_specification_opt ::= ASC */ - -1, /* (779) ordering_specification_opt ::= DESC */ - 0, /* (780) null_ordering_opt ::= */ - -2, /* (781) null_ordering_opt ::= NULLS FIRST */ - -2, /* (782) null_ordering_opt ::= NULLS LAST */ - 0, /* (783) column_options ::= */ - -3, /* (784) column_options ::= column_options PRIMARY KEY */ - -3, /* (785) column_options ::= column_options NK_ID NK_STRING */ -}; - -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 */ - ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ - ParseCTX_PDECL /* %extra_context */ -){ - 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 */ - ParseARG_FETCH - (void)yyLookahead; - (void)yyLookaheadToken; - yymsp = yypParser->yytos; - - switch( yyruleno ){ - /* Beginning here are the reduction cases. A typical example - ** follows: - ** case 0: - ** #line - ** { ... } // User supplied code - ** #line - ** break; - */ -/********** Begin reduce actions **********************************************/ - YYMINORTYPE yylhsminor; - case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ -{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,391,&yymsp[0].minor); - break; - case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ -{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,392,&yymsp[0].minor); - 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); -{ yy_destructor(yypParser,391,&yymsp[-2].minor); -{ } - yy_destructor(yypParser,393,&yymsp[0].minor); -} - break; - case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,394,&yymsp[0].minor); -{ } -} - break; - case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,392,&yymsp[-1].minor); -{ } - yy_destructor(yypParser,394,&yymsp[0].minor); -} - 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); -{ } - yy_destructor(yypParser,393,&yymsp[0].minor); - break; - case 24: /* ip_range_list ::= NK_STRING */ -{ yylhsminor.yy628 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy628 = yylhsminor.yy628; - break; - case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ -{ yylhsminor.yy628 = addNodeToList(pCxt, yymsp[-2].minor.yy628, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy628 = yylhsminor.yy628; - break; - case 26: /* white_list ::= HOST ip_range_list */ -{ yymsp[-1].minor.yy628 = yymsp[0].minor.yy628; } - break; - case 27: /* white_list_opt ::= */ - case 213: /* specific_cols_opt ::= */ yytestcase(yyruleno==213); - case 251: /* tags_def_opt ::= */ yytestcase(yyruleno==251); - case 344: /* tag_list_opt ::= */ yytestcase(yyruleno==344); - case 417: /* col_list_opt ::= */ yytestcase(yyruleno==417); - case 424: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==424); - case 709: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==709); - case 741: /* group_by_clause_opt ::= */ yytestcase(yyruleno==741); - case 761: /* order_by_clause_opt ::= */ yytestcase(yyruleno==761); -{ yymsp[1].minor.yy628 = NULL; } - break; - case 28: /* white_list_opt ::= white_list */ - case 252: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==252); - case 425: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==425); - case 617: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==617); -{ yylhsminor.yy628 = yymsp[0].minor.yy628; } - yymsp[0].minor.yy628 = yylhsminor.yy628; - break; - case 29: /* is_import_opt ::= */ - case 31: /* is_createdb_opt ::= */ yytestcase(yyruleno==31); -{ yymsp[1].minor.yy47 = 0; } - break; - case 30: /* is_import_opt ::= IS_IMPORT NK_INTEGER */ - case 32: /* is_createdb_opt ::= CREATEDB NK_INTEGER */ yytestcase(yyruleno==32); - case 42: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ yytestcase(yyruleno==42); -{ yymsp[-1].minor.yy47 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } - break; - case 33: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ -{ - pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-6].minor.yy561, &yymsp[-4].minor.yy0, yymsp[-3].minor.yy47, yymsp[-1].minor.yy47, yymsp[-2].minor.yy47); - pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy628); - } - break; - case 34: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } - break; - case 35: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } - break; - case 36: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } - break; - case 37: /* cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_CREATEDB, &yymsp[0].minor.yy0); } - break; - case 38: /* cmd ::= ALTER USER user_name ADD white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy628); } - break; - case 39: /* cmd ::= ALTER USER user_name DROP white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy628); } - break; - case 40: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy561); } - break; - case 41: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy47 = 1; } - break; - case 43: /* cmd ::= GRANT privileges ON priv_level with_clause_opt TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy781, &yymsp[-3].minor.yy469, &yymsp[0].minor.yy561, yymsp[-2].minor.yy980); } - break; - case 44: /* cmd ::= REVOKE privileges ON priv_level with_clause_opt FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy781, &yymsp[-3].minor.yy469, &yymsp[0].minor.yy561, yymsp[-2].minor.yy980); } - break; - case 45: /* privileges ::= ALL */ -{ yymsp[0].minor.yy781 = PRIVILEGE_TYPE_ALL; } - break; - case 46: /* privileges ::= priv_type_list */ - case 48: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==48); -{ yylhsminor.yy781 = yymsp[0].minor.yy781; } - yymsp[0].minor.yy781 = yylhsminor.yy781; - break; - case 47: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy781 = PRIVILEGE_TYPE_SUBSCRIBE; } - break; - case 49: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy781 = yymsp[-2].minor.yy781 | yymsp[0].minor.yy781; } - yymsp[-2].minor.yy781 = yylhsminor.yy781; - break; - case 50: /* priv_type ::= READ */ -{ yymsp[0].minor.yy781 = PRIVILEGE_TYPE_READ; } - break; - case 51: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy781 = PRIVILEGE_TYPE_WRITE; } - break; - case 52: /* priv_type ::= ALTER */ -{ yymsp[0].minor.yy781 = PRIVILEGE_TYPE_ALTER; } - break; - case 53: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy469.first = yymsp[-2].minor.yy0; yylhsminor.yy469.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy469 = yylhsminor.yy469; - break; - case 54: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy469.first = yymsp[-2].minor.yy561; yylhsminor.yy469.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy469 = yylhsminor.yy469; - break; - case 55: /* priv_level ::= db_name NK_DOT table_name */ -{ yylhsminor.yy469.first = yymsp[-2].minor.yy561; yylhsminor.yy469.second = yymsp[0].minor.yy561; } - yymsp[-2].minor.yy469 = yylhsminor.yy469; - break; - case 56: /* priv_level ::= topic_name */ -{ yylhsminor.yy469.first = yymsp[0].minor.yy561; yylhsminor.yy469.second = nil_token; } - yymsp[0].minor.yy469 = yylhsminor.yy469; - break; - case 57: /* with_clause_opt ::= */ - case 178: /* start_opt ::= */ yytestcase(yyruleno==178); - case 182: /* end_opt ::= */ yytestcase(yyruleno==182); - case 339: /* like_pattern_opt ::= */ yytestcase(yyruleno==339); - case 437: /* subtable_opt ::= */ yytestcase(yyruleno==437); - case 627: /* case_when_else_opt ::= */ yytestcase(yyruleno==627); - case 657: /* from_clause_opt ::= */ yytestcase(yyruleno==657); - case 684: /* join_on_clause_opt ::= */ yytestcase(yyruleno==684); - case 686: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==686); - case 690: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==690); - case 707: /* where_clause_opt ::= */ yytestcase(yyruleno==707); - case 716: /* twindow_clause_opt ::= */ yytestcase(yyruleno==716); - case 726: /* sliding_opt ::= */ yytestcase(yyruleno==726); - case 731: /* fill_opt ::= */ yytestcase(yyruleno==731); - case 745: /* having_clause_opt ::= */ yytestcase(yyruleno==745); - case 747: /* range_opt ::= */ yytestcase(yyruleno==747); - case 750: /* every_opt ::= */ yytestcase(yyruleno==750); - case 763: /* slimit_clause_opt ::= */ yytestcase(yyruleno==763); - case 767: /* limit_clause_opt ::= */ yytestcase(yyruleno==767); -{ yymsp[1].minor.yy980 = NULL; } - break; - case 58: /* with_clause_opt ::= WITH search_condition */ - case 658: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==658); - case 685: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==685); - case 708: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==708); - case 746: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==746); -{ yymsp[-1].minor.yy980 = yymsp[0].minor.yy980; } - break; - case 59: /* cmd ::= CREATE ENCRYPT_KEY NK_STRING */ -{ pCxt->pRootNode = createEncryptKeyStmt(pCxt, &yymsp[0].minor.yy0); } - break; - case 60: /* cmd ::= CREATE ANODE NK_STRING */ -{ pCxt->pRootNode = createCreateAnodeStmt(pCxt, &yymsp[0].minor.yy0); } - break; - case 61: /* cmd ::= UPDATE ANODE NK_INTEGER */ -{ pCxt->pRootNode = createUpdateAnodeStmt(pCxt, &yymsp[0].minor.yy0, false); } - break; - case 62: /* cmd ::= UPDATE ALL ANODES */ -{ pCxt->pRootNode = createUpdateAnodeStmt(pCxt, NULL, true); } - break; - case 63: /* cmd ::= DROP ANODE NK_INTEGER */ -{ pCxt->pRootNode = createDropAnodeStmt(pCxt, &yymsp[0].minor.yy0); } - break; - case 64: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy561, NULL); } - break; - case 65: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0); } - break; - case 66: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy957, false); } - break; - case 67: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy561, yymsp[0].minor.yy957, false); } - break; - case 68: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy957); } - break; - case 69: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy561, false, yymsp[0].minor.yy957); } - break; - case 70: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ -{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } - break; - case 71: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ -{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } - break; - case 72: /* cmd ::= ALTER ALL DNODES NK_STRING */ -{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); } - break; - case 73: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ -{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } - break; - case 74: /* cmd ::= RESTORE DNODE NK_INTEGER */ -{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_DNODE_STMT, &yymsp[0].minor.yy0); } - break; - case 75: /* dnode_endpoint ::= NK_STRING */ - case 76: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==76); - case 77: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==77); - case 373: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==373); - case 374: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==374); - case 375: /* sma_func_name ::= LAST */ yytestcase(yyruleno==375); - case 376: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==376); - case 525: /* db_name ::= NK_ID */ yytestcase(yyruleno==525); - case 526: /* table_name ::= NK_ID */ yytestcase(yyruleno==526); - case 527: /* column_name ::= NK_ID */ yytestcase(yyruleno==527); - case 528: /* function_name ::= NK_ID */ yytestcase(yyruleno==528); - case 529: /* view_name ::= NK_ID */ yytestcase(yyruleno==529); - case 530: /* table_alias ::= NK_ID */ yytestcase(yyruleno==530); - case 531: /* column_alias ::= NK_ID */ yytestcase(yyruleno==531); - case 532: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==532); - case 533: /* user_name ::= NK_ID */ yytestcase(yyruleno==533); - case 534: /* topic_name ::= NK_ID */ yytestcase(yyruleno==534); - case 535: /* stream_name ::= NK_ID */ yytestcase(yyruleno==535); - case 536: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==536); - case 537: /* index_name ::= NK_ID */ yytestcase(yyruleno==537); - case 538: /* tsma_name ::= NK_ID */ yytestcase(yyruleno==538); - case 597: /* substr_func ::= SUBSTR */ yytestcase(yyruleno==597); - case 598: /* substr_func ::= SUBSTRING */ yytestcase(yyruleno==598); - case 602: /* noarg_func ::= NOW */ yytestcase(yyruleno==602); - case 603: /* noarg_func ::= TODAY */ yytestcase(yyruleno==603); - case 604: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==604); - case 605: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==605); - case 606: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==606); - case 607: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==607); - case 608: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==608); - case 609: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==609); - case 610: /* noarg_func ::= USER */ yytestcase(yyruleno==610); - case 611: /* noarg_func ::= PI */ yytestcase(yyruleno==611); - case 612: /* star_func ::= COUNT */ yytestcase(yyruleno==612); - case 613: /* star_func ::= FIRST */ yytestcase(yyruleno==613); - case 614: /* star_func ::= LAST */ yytestcase(yyruleno==614); - case 615: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==615); -{ yylhsminor.yy561 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy561 = yylhsminor.yy561; - break; - case 78: /* force_opt ::= */ - case 105: /* not_exists_opt ::= */ yytestcase(yyruleno==105); - case 107: /* exists_opt ::= */ yytestcase(yyruleno==107); - case 211: /* with_opt ::= */ yytestcase(yyruleno==211); - case 394: /* analyze_opt ::= */ yytestcase(yyruleno==394); - case 401: /* agg_func_opt ::= */ yytestcase(yyruleno==401); - case 407: /* or_replace_opt ::= */ yytestcase(yyruleno==407); - case 439: /* ignore_opt ::= */ yytestcase(yyruleno==439); - case 695: /* tag_mode_opt ::= */ yytestcase(yyruleno==695); - case 697: /* set_quantifier_opt ::= */ yytestcase(yyruleno==697); -{ yymsp[1].minor.yy957 = false; } - break; - case 79: /* force_opt ::= FORCE */ - case 80: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==80); - case 212: /* with_opt ::= WITH */ yytestcase(yyruleno==212); - case 395: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==395); - case 402: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==402); - case 696: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==696); - case 698: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==698); -{ yymsp[0].minor.yy957 = true; } - break; - case 81: /* cmd ::= ALTER CLUSTER NK_STRING */ -{ pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[0].minor.yy0, NULL); } - break; - case 82: /* cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ -{ pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } - break; - case 83: /* cmd ::= ALTER LOCAL NK_STRING */ -{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } - break; - case 84: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ -{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } - break; - case 85: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ -{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); } - break; - case 86: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ -{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); } - break; - case 87: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ -{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &yymsp[0].minor.yy0); } - break; - case 88: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ -{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); } - break; - case 89: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */ -{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); } - break; - case 90: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ -{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); } - break; - case 91: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */ -{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); } - break; - case 92: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ -{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); } - break; - case 93: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */ -{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } - break; - case 94: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ -{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &yymsp[0].minor.yy0); } - break; - case 95: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ -{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } - break; - case 96: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy957, &yymsp[-1].minor.yy561, yymsp[0].minor.yy980); } - break; - case 97: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy561); } - break; - case 98: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy561); } - break; - case 99: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy561, yymsp[0].minor.yy980); } - break; - case 100: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy561); } - break; - case 101: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy561, yymsp[0].minor.yy844); } - break; - case 102: /* cmd ::= S3MIGRATE DATABASE db_name */ -{ pCxt->pRootNode = createS3MigrateDatabaseStmt(pCxt, &yymsp[0].minor.yy561); } - break; - case 103: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy561, yymsp[-1].minor.yy980, yymsp[0].minor.yy980); } - break; - case 104: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy957 = true; } - break; - case 106: /* exists_opt ::= IF EXISTS */ - case 408: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==408); - case 440: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==440); -{ yymsp[-1].minor.yy957 = true; } - break; - case 108: /* db_options ::= */ -{ yymsp[1].minor.yy980 = createDefaultDatabaseOptions(pCxt); } - break; - case 109: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 110: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 111: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 112: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 113: /* db_options ::= db_options DURATION NK_INTEGER */ - case 114: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==114); -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 115: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 116: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 117: /* db_options ::= db_options KEEP integer_list */ - case 118: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==118); -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_KEEP, yymsp[0].minor.yy628); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 119: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 120: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 121: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 122: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 123: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 124: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 125: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 126: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_RETENTIONS, yymsp[0].minor.yy628); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 127: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 128: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 129: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 130: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 131: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-3].minor.yy980, DB_OPTION_WAL_RETENTION_PERIOD, &t); - } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 132: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 133: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-3].minor.yy980, DB_OPTION_WAL_RETENTION_SIZE, &t); - } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 134: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 135: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 136: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 137: /* db_options ::= db_options TABLE_PREFIX signed */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy980); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 138: /* db_options ::= db_options TABLE_SUFFIX signed */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy980); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 139: /* db_options ::= db_options S3_CHUNKPAGES NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_S3_CHUNKPAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 140: /* db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ - case 141: /* db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==141); -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_S3_KEEPLOCAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 142: /* db_options ::= db_options S3_COMPACT NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_S3_COMPACT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 143: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 144: /* db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_ENCRYPT_ALGORITHM, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 145: /* db_options ::= db_options DNODES NK_STRING */ -{ yylhsminor.yy980 = setDatabaseOption(pCxt, yymsp[-2].minor.yy980, DB_OPTION_DNODES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 146: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy980 = createAlterDatabaseOptions(pCxt); yylhsminor.yy980 = setAlterDatabaseOption(pCxt, yylhsminor.yy980, &yymsp[0].minor.yy529); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 147: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy980 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy980, &yymsp[0].minor.yy529); } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 148: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy529.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 149: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy529.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 150: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy529.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 151: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy529.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 152: /* alter_db_option ::= KEEP integer_list */ - case 153: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==153); -{ yymsp[-1].minor.yy529.type = DB_OPTION_KEEP; yymsp[-1].minor.yy529.pList = yymsp[0].minor.yy628; } - break; - case 154: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy529.type = DB_OPTION_PAGES; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 155: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy529.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 156: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy529.type = DB_OPTION_WAL; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 157: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy529.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 158: /* alter_db_option ::= MINROWS NK_INTEGER */ -{ yymsp[-1].minor.yy529.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 159: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy529.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 160: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy529.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy529.val = t; - } - break; - case 161: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ -{ yymsp[-1].minor.yy529.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 162: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy529.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy529.val = t; - } - break; - case 163: /* alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ - case 164: /* alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==164); -{ yymsp[-1].minor.yy529.type = DB_OPTION_S3_KEEPLOCAL; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 165: /* alter_db_option ::= S3_COMPACT NK_INTEGER */ -{ yymsp[-1].minor.yy529.type = DB_OPTION_S3_COMPACT, yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 166: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ -{ yymsp[-1].minor.yy529.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 167: /* alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ -{ yymsp[-1].minor.yy529.type = DB_OPTION_ENCRYPT_ALGORITHM; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 168: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy628 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy628 = yylhsminor.yy628; - break; - case 169: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 454: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==454); -{ yylhsminor.yy628 = addNodeToList(pCxt, yymsp[-2].minor.yy628, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy628 = yylhsminor.yy628; - break; - case 170: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy628 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy628 = yylhsminor.yy628; - break; - case 171: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy628 = addNodeToList(pCxt, yymsp[-2].minor.yy628, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy628 = yylhsminor.yy628; - break; - case 172: /* retention_list ::= retention */ - case 205: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==205); - case 208: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==208); - case 217: /* tag_def_list ::= tag_def */ yytestcase(yyruleno==217); - case 220: /* column_def_list ::= column_def */ yytestcase(yyruleno==220); - case 268: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==268); - case 273: /* col_name_list ::= col_name */ yytestcase(yyruleno==273); - case 345: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==345); - case 369: /* func_list ::= func */ yytestcase(yyruleno==369); - case 419: /* column_stream_def_list ::= column_stream_def */ yytestcase(yyruleno==419); - case 498: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==498); - case 523: /* literal_list ::= signed_literal */ yytestcase(yyruleno==523); - case 618: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==618); - case 624: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==624); - case 700: /* select_list ::= select_item */ yytestcase(yyruleno==700); - case 711: /* partition_list ::= partition_item */ yytestcase(yyruleno==711); - case 774: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==774); -{ yylhsminor.yy628 = createNodeList(pCxt, yymsp[0].minor.yy980); } - yymsp[0].minor.yy628 = yylhsminor.yy628; - break; - case 173: /* retention_list ::= retention_list NK_COMMA retention */ - case 209: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==209); - case 218: /* tag_def_list ::= tag_def_list NK_COMMA tag_def */ yytestcase(yyruleno==218); - case 221: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==221); - case 269: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==269); - case 274: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==274); - case 346: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==346); - case 370: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==370); - case 420: /* column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ yytestcase(yyruleno==420); - case 499: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==499); - case 524: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==524); - case 619: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==619); - case 701: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==701); - case 712: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==712); - case 775: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==775); -{ yylhsminor.yy628 = addNodeToList(pCxt, yymsp[-2].minor.yy628, yymsp[0].minor.yy980); } - yymsp[-2].minor.yy628 = yylhsminor.yy628; - break; - case 174: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - case 175: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==175); -{ yylhsminor.yy980 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 176: /* speed_opt ::= */ - case 403: /* bufsize_opt ::= */ yytestcase(yyruleno==403); -{ yymsp[1].minor.yy844 = 0; } - break; - case 177: /* speed_opt ::= BWLIMIT NK_INTEGER */ - case 404: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==404); -{ yymsp[-1].minor.yy844 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } - break; - case 179: /* start_opt ::= START WITH NK_INTEGER */ - case 183: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==183); -{ yymsp[-2].minor.yy980 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } - break; - case 180: /* start_opt ::= START WITH NK_STRING */ - case 184: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==184); -{ yymsp[-2].minor.yy980 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } - break; - case 181: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ - case 185: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==185); -{ yymsp[-3].minor.yy980 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } - break; - case 186: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - case 189: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==189); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy957, yymsp[-5].minor.yy980, yymsp[-3].minor.yy628, yymsp[-1].minor.yy628, yymsp[0].minor.yy980); } - break; - case 187: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy628); } - break; - case 188: /* cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ -{ pCxt->pRootNode = createCreateSubTableFromFileClause(pCxt, yymsp[-7].minor.yy957, yymsp[-5].minor.yy980, yymsp[-3].minor.yy628, &yymsp[0].minor.yy0); } - break; - case 190: /* cmd ::= DROP TABLE with_opt multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[-1].minor.yy957, yymsp[0].minor.yy628); } - break; - case 191: /* cmd ::= DROP STABLE with_opt exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-2].minor.yy957, yymsp[-1].minor.yy957, yymsp[0].minor.yy980); } - break; - case 192: /* cmd ::= ALTER TABLE alter_table_clause */ - case 456: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==456); - case 457: /* cmd ::= insert_query */ yytestcase(yyruleno==457); -{ pCxt->pRootNode = yymsp[0].minor.yy980; } - break; - case 193: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy980); } - break; - case 194: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy980 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy980, yymsp[0].minor.yy980); } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 195: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ -{ yylhsminor.yy980 = createAlterTableAddModifyColOptions2(pCxt, yymsp[-5].minor.yy980, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-2].minor.yy561, yymsp[-1].minor.yy896, yymsp[0].minor.yy980); } - yymsp[-5].minor.yy980 = yylhsminor.yy980; - break; - case 196: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy980 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy980, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy561); } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 197: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy980 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy980, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy561, yymsp[0].minor.yy896); } - yymsp[-4].minor.yy980 = yylhsminor.yy980; - break; - case 198: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ -{ yylhsminor.yy980 = createAlterTableAddModifyColOptions(pCxt, yymsp[-4].minor.yy980, TSDB_ALTER_TABLE_UPDATE_COLUMN_COMPRESS, &yymsp[-1].minor.yy561, yymsp[0].minor.yy980); } - yymsp[-4].minor.yy980 = yylhsminor.yy980; - break; - case 199: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy980 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy980, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy561, &yymsp[0].minor.yy561); } - yymsp[-4].minor.yy980 = yylhsminor.yy980; - break; - case 200: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy980 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy980, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy561, yymsp[0].minor.yy896); } - yymsp[-4].minor.yy980 = yylhsminor.yy980; - break; - case 201: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy980 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy980, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy561); } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 202: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy980 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy980, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy561, yymsp[0].minor.yy896); } - yymsp[-4].minor.yy980 = yylhsminor.yy980; - break; - case 203: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy980 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy980, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy561, &yymsp[0].minor.yy561); } - yymsp[-4].minor.yy980 = yylhsminor.yy980; - break; - case 204: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ -{ yylhsminor.yy980 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy980, &yymsp[-2].minor.yy561, yymsp[0].minor.yy980); } - yymsp[-5].minor.yy980 = yylhsminor.yy980; - break; - case 206: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 625: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==625); -{ yylhsminor.yy628 = addNodeToList(pCxt, yymsp[-1].minor.yy628, yymsp[0].minor.yy980); } - yymsp[-1].minor.yy628 = yylhsminor.yy628; - break; - case 207: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ -{ yylhsminor.yy980 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy957, yymsp[-8].minor.yy980, yymsp[-6].minor.yy980, yymsp[-5].minor.yy628, yymsp[-2].minor.yy628, yymsp[0].minor.yy980); } - yymsp[-9].minor.yy980 = yylhsminor.yy980; - break; - case 210: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy980 = createDropTableClause(pCxt, yymsp[-1].minor.yy957, yymsp[0].minor.yy980); } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 214: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ - case 418: /* col_list_opt ::= NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==418); -{ yymsp[-2].minor.yy628 = yymsp[-1].minor.yy628; } - break; - case 215: /* full_table_name ::= table_name */ - case 359: /* full_tsma_name ::= tsma_name */ yytestcase(yyruleno==359); -{ yylhsminor.yy980 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy561, NULL); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 216: /* full_table_name ::= db_name NK_DOT table_name */ - case 360: /* full_tsma_name ::= db_name NK_DOT tsma_name */ yytestcase(yyruleno==360); -{ yylhsminor.yy980 = createRealTableNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561, NULL); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 219: /* tag_def ::= column_name type_name */ -{ yylhsminor.yy980 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy561, yymsp[0].minor.yy896, NULL); } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 222: /* column_def ::= column_name type_name column_options */ -{ yylhsminor.yy980 = createColumnDefNode(pCxt, &yymsp[-2].minor.yy561, yymsp[-1].minor.yy896, yymsp[0].minor.yy980); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 223: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy896 = createDataType(TSDB_DATA_TYPE_BOOL); } - break; - case 224: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy896 = createDataType(TSDB_DATA_TYPE_TINYINT); } - break; - case 225: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy896 = createDataType(TSDB_DATA_TYPE_SMALLINT); } - break; - case 226: /* type_name ::= INT */ - case 227: /* type_name ::= INTEGER */ yytestcase(yyruleno==227); -{ yymsp[0].minor.yy896 = createDataType(TSDB_DATA_TYPE_INT); } - break; - case 228: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy896 = createDataType(TSDB_DATA_TYPE_BIGINT); } - break; - case 229: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy896 = createDataType(TSDB_DATA_TYPE_FLOAT); } - break; - case 230: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy896 = createDataType(TSDB_DATA_TYPE_DOUBLE); } - break; - case 231: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy896 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } - break; - case 232: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy896 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } - break; - case 233: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy896 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } - break; - case 234: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy896 = createDataType(TSDB_DATA_TYPE_UTINYINT); } - break; - case 235: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy896 = createDataType(TSDB_DATA_TYPE_USMALLINT); } - break; - case 236: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy896 = createDataType(TSDB_DATA_TYPE_UINT); } - break; - case 237: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy896 = createDataType(TSDB_DATA_TYPE_UBIGINT); } - break; - case 238: /* type_name ::= JSON */ -{ yymsp[0].minor.yy896 = createDataType(TSDB_DATA_TYPE_JSON); } - break; - case 239: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy896 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } - break; - case 240: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy896 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } - break; - case 241: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy896 = createDataType(TSDB_DATA_TYPE_BLOB); } - break; - case 242: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy896 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } - break; - case 243: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy896 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } - break; - case 244: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy896 = createDataType(TSDB_DATA_TYPE_DECIMAL); } - break; - case 245: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy896 = createDataType(TSDB_DATA_TYPE_DECIMAL); } - break; - case 246: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy896 = createDataType(TSDB_DATA_TYPE_DECIMAL); } - break; - case 247: /* type_name_default_len ::= BINARY */ -{ yymsp[0].minor.yy896 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, NULL); } - break; - case 248: /* type_name_default_len ::= NCHAR */ -{ yymsp[0].minor.yy896 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, NULL); } - break; - case 249: /* type_name_default_len ::= VARCHAR */ -{ yymsp[0].minor.yy896 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, NULL); } - break; - case 250: /* type_name_default_len ::= VARBINARY */ -{ yymsp[0].minor.yy896 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, NULL); } - break; - case 253: /* tags_def ::= TAGS NK_LP tag_def_list NK_RP */ - case 426: /* tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==426); -{ yymsp[-3].minor.yy628 = yymsp[-1].minor.yy628; } - break; - case 254: /* table_options ::= */ -{ yymsp[1].minor.yy980 = createDefaultTableOptions(pCxt); } - break; - case 255: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy980 = setTableOption(pCxt, yymsp[-2].minor.yy980, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 256: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy980 = setTableOption(pCxt, yymsp[-2].minor.yy980, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy628); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 257: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy980 = setTableOption(pCxt, yymsp[-2].minor.yy980, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy628); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 258: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy980 = setTableOption(pCxt, yymsp[-4].minor.yy980, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy628); } - yymsp[-4].minor.yy980 = yylhsminor.yy980; - break; - case 259: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy980 = setTableOption(pCxt, yymsp[-2].minor.yy980, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 260: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy980 = setTableOption(pCxt, yymsp[-4].minor.yy980, TABLE_OPTION_SMA, yymsp[-1].minor.yy628); } - yymsp[-4].minor.yy980 = yylhsminor.yy980; - break; - case 261: /* table_options ::= table_options DELETE_MARK duration_list */ -{ yylhsminor.yy980 = setTableOption(pCxt, yymsp[-2].minor.yy980, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy628); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 262: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy980 = createAlterTableOptions(pCxt); yylhsminor.yy980 = setTableOption(pCxt, yylhsminor.yy980, yymsp[0].minor.yy529.type, &yymsp[0].minor.yy529.val); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 263: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy980 = setTableOption(pCxt, yymsp[-1].minor.yy980, yymsp[0].minor.yy529.type, &yymsp[0].minor.yy529.val); } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 264: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy529.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 265: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy529.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; } - break; - case 266: /* duration_list ::= duration_literal */ - case 556: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==556); -{ yylhsminor.yy628 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy980)); } - yymsp[0].minor.yy628 = yylhsminor.yy628; - break; - case 267: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 557: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==557); -{ yylhsminor.yy628 = addNodeToList(pCxt, yymsp[-2].minor.yy628, releaseRawExprNode(pCxt, yymsp[0].minor.yy980)); } - yymsp[-2].minor.yy628 = yylhsminor.yy628; - break; - case 270: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy980 = createFunctionNode(pCxt, &yymsp[0].minor.yy561, NULL); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 271: /* rollup_func_name ::= FIRST */ - case 272: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==272); - case 348: /* tag_item ::= QTAGS */ yytestcase(yyruleno==348); -{ yylhsminor.yy980 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 275: /* col_name ::= column_name */ - case 349: /* tag_item ::= column_name */ yytestcase(yyruleno==349); -{ yylhsminor.yy980 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy561); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 276: /* cmd ::= SHOW DNODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } - break; - case 277: /* cmd ::= SHOW USERS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } - break; - case 278: /* cmd ::= SHOW USERS FULL */ -{ pCxt->pRootNode = createShowStmtWithFull(pCxt, QUERY_NODE_SHOW_USERS_FULL_STMT); } - break; - case 279: /* cmd ::= SHOW USER PRIVILEGES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } - break; - case 280: /* cmd ::= SHOW db_kind_opt DATABASES */ -{ - pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); - (void)setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy1041); - } - break; - case 281: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ -{ - pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy513, yymsp[0].minor.yy980, OP_TYPE_LIKE); - } - break; - case 282: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy980, yymsp[0].minor.yy980, OP_TYPE_LIKE); } - break; - case 283: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy980, NULL, OP_TYPE_LIKE); } - break; - case 284: /* cmd ::= SHOW MNODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } - break; - case 285: /* cmd ::= SHOW QNODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } - break; - case 286: /* cmd ::= SHOW ANODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ANODES_STMT); } - break; - case 287: /* cmd ::= SHOW ANODES FULL */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ANODES_FULL_STMT); } - break; - case 288: /* cmd ::= SHOW ARBGROUPS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ARBGROUPS_STMT); } - break; - case 289: /* cmd ::= SHOW FUNCTIONS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } - break; - case 290: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy980, yymsp[-1].minor.yy980, OP_TYPE_EQUAL); } - break; - case 291: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy561), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561), OP_TYPE_EQUAL); } - break; - case 292: /* cmd ::= SHOW STREAMS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } - break; - case 293: /* cmd ::= SHOW ACCOUNTS */ -{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - break; - case 294: /* cmd ::= SHOW APPS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } - break; - case 295: /* cmd ::= SHOW CONNECTIONS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } - break; - case 296: /* cmd ::= SHOW LICENCES */ - case 297: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==297); -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } - break; - case 298: /* cmd ::= SHOW GRANTS FULL */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_FULL_STMT); } - break; - case 299: /* cmd ::= SHOW GRANTS LOGS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_LOGS_STMT); } - break; - case 300: /* cmd ::= SHOW CLUSTER MACHINES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT); } - break; - case 301: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy561); } - break; - case 302: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy980); } - break; - case 303: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, -yymsp[0].minor.yy980); } - break; - case 304: /* cmd ::= SHOW ENCRYPTIONS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ENCRYPTIONS_STMT); } - break; - case 305: /* cmd ::= SHOW QUERIES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } - break; - case 306: /* cmd ::= SHOW SCORES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } - break; - case 307: /* cmd ::= SHOW TOPICS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } - break; - case 308: /* cmd ::= SHOW VARIABLES */ - case 309: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==309); -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } - break; - case 310: /* cmd ::= SHOW LOCAL VARIABLES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } - break; - case 311: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy980); } - break; - case 312: /* cmd ::= SHOW BNODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } - break; - case 313: /* cmd ::= SHOW SNODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } - break; - case 314: /* cmd ::= SHOW CLUSTER */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } - break; - case 315: /* cmd ::= SHOW TRANSACTIONS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } - break; - case 316: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy980); } - break; - case 317: /* cmd ::= SHOW CONSUMERS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } - break; - case 318: /* cmd ::= SHOW SUBSCRIPTIONS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } - break; - case 319: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy980, yymsp[-1].minor.yy980, OP_TYPE_EQUAL); } - break; - case 320: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy561), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561), OP_TYPE_EQUAL); } - break; - case 321: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy980, yymsp[0].minor.yy980, yymsp[-3].minor.yy628); } - break; - case 322: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy561), yymsp[-4].minor.yy628); } - break; - case 323: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ -{ pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } - break; - case 324: /* cmd ::= SHOW VNODES */ -{ pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } - break; - case 325: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy980, QUERY_NODE_SHOW_DB_ALIVE_STMT); } - break; - case 326: /* cmd ::= SHOW CLUSTER ALIVE */ -{ pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } - break; - case 327: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy980, yymsp[0].minor.yy980, OP_TYPE_LIKE); } - break; - case 328: /* cmd ::= SHOW CREATE VIEW full_table_name */ -{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy980); } - break; - case 329: /* cmd ::= SHOW COMPACTS */ -{ pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); } - break; - case 330: /* cmd ::= SHOW COMPACT NK_INTEGER */ -{ pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - break; - case 331: /* table_kind_db_name_cond_opt ::= */ -{ yymsp[1].minor.yy513.kind = SHOW_KIND_ALL; yymsp[1].minor.yy513.dbName = nil_token; } - break; - case 332: /* table_kind_db_name_cond_opt ::= table_kind */ -{ yylhsminor.yy513.kind = yymsp[0].minor.yy1041; yylhsminor.yy513.dbName = nil_token; } - yymsp[0].minor.yy513 = yylhsminor.yy513; - break; - case 333: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy513.kind = SHOW_KIND_ALL; yylhsminor.yy513.dbName = yymsp[-1].minor.yy561; } - yymsp[-1].minor.yy513 = yylhsminor.yy513; - break; - case 334: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ -{ yylhsminor.yy513.kind = yymsp[-2].minor.yy1041; yylhsminor.yy513.dbName = yymsp[-1].minor.yy561; } - yymsp[-2].minor.yy513 = yylhsminor.yy513; - break; - case 335: /* table_kind ::= NORMAL */ -{ yymsp[0].minor.yy1041 = SHOW_KIND_TABLES_NORMAL; } - break; - case 336: /* table_kind ::= CHILD */ -{ yymsp[0].minor.yy1041 = SHOW_KIND_TABLES_CHILD; } - break; - case 337: /* db_name_cond_opt ::= */ - case 342: /* from_db_opt ::= */ yytestcase(yyruleno==342); -{ yymsp[1].minor.yy980 = createDefaultDatabaseCondValue(pCxt); } - break; - case 338: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy980 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy561); } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 340: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy980 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - break; - case 341: /* table_name_cond ::= table_name */ -{ yylhsminor.yy980 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 343: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy980 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561); } - break; - case 347: /* tag_item ::= TBNAME */ -{ yylhsminor.yy980 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 350: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy980 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy561), &yymsp[0].minor.yy561); } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 351: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy980 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy561), &yymsp[0].minor.yy561); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 352: /* db_kind_opt ::= */ -{ yymsp[1].minor.yy1041 = SHOW_KIND_ALL; } - break; - case 353: /* db_kind_opt ::= USER */ -{ yymsp[0].minor.yy1041 = SHOW_KIND_DATABASES_USER; } - break; - case 354: /* db_kind_opt ::= SYSTEM */ -{ yymsp[0].minor.yy1041 = SHOW_KIND_DATABASES_SYSTEM; } - break; - case 355: /* cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ -{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-8].minor.yy957, &yymsp[-7].minor.yy561, yymsp[-4].minor.yy980, yymsp[-5].minor.yy980, releaseRawExprNode(pCxt, yymsp[-1].minor.yy980)); } - break; - case 356: /* cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ -{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-7].minor.yy957, &yymsp[-6].minor.yy561, NULL, yymsp[-4].minor.yy980, releaseRawExprNode(pCxt, yymsp[-1].minor.yy980)); } - break; - case 357: /* cmd ::= DROP TSMA exists_opt full_tsma_name */ -{ pCxt->pRootNode = createDropTSMAStmt(pCxt, yymsp[-1].minor.yy957, yymsp[0].minor.yy980); } - break; - case 358: /* cmd ::= SHOW db_name_cond_opt TSMAS */ -{ pCxt->pRootNode = createShowTSMASStmt(pCxt, yymsp[-1].minor.yy980); } - break; - case 361: /* tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ -{ yymsp[-3].minor.yy980 = createTSMAOptions(pCxt, yymsp[-1].minor.yy628); } - break; - case 362: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy957, yymsp[-3].minor.yy980, yymsp[-1].minor.yy980, NULL, yymsp[0].minor.yy980); } - break; - case 363: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy957, yymsp[-5].minor.yy980, yymsp[-3].minor.yy980, yymsp[-1].minor.yy628, NULL); } - break; - case 364: /* cmd ::= DROP INDEX exists_opt full_index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy957, yymsp[0].minor.yy980); } - break; - case 365: /* full_index_name ::= index_name */ -{ yylhsminor.yy980 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy561); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 366: /* full_index_name ::= db_name NK_DOT index_name */ -{ yylhsminor.yy980 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 367: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy980 = createIndexOption(pCxt, yymsp[-7].minor.yy628, releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), NULL, yymsp[-1].minor.yy980, yymsp[0].minor.yy980); } - break; - case 368: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-11].minor.yy980 = createIndexOption(pCxt, yymsp[-9].minor.yy628, releaseRawExprNode(pCxt, yymsp[-5].minor.yy980), releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), yymsp[-1].minor.yy980, yymsp[0].minor.yy980); } - break; - case 371: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy980 = createFunctionNode(pCxt, &yymsp[-3].minor.yy561, yymsp[-1].minor.yy628); } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 372: /* sma_func_name ::= function_name */ - case 668: /* alias_opt ::= table_alias */ yytestcase(yyruleno==668); -{ yylhsminor.yy561 = yymsp[0].minor.yy561; } - yymsp[0].minor.yy561 = yylhsminor.yy561; - break; - case 377: /* sma_stream_opt ::= */ - case 427: /* stream_options ::= */ yytestcase(yyruleno==427); -{ yymsp[1].minor.yy980 = createStreamOptions(pCxt); } - break; - case 378: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy980)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy980); yylhsminor.yy980 = yymsp[-2].minor.yy980; } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 379: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy980)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy980); yylhsminor.yy980 = yymsp[-2].minor.yy980; } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 380: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy980)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy980); yylhsminor.yy980 = yymsp[-2].minor.yy980; } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 381: /* with_meta ::= AS */ -{ yymsp[0].minor.yy844 = 0; } - break; - case 382: /* with_meta ::= WITH META AS */ -{ yymsp[-2].minor.yy844 = 1; } - break; - case 383: /* with_meta ::= ONLY META AS */ -{ yymsp[-2].minor.yy844 = 2; } - break; - case 384: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy957, &yymsp[-2].minor.yy561, yymsp[0].minor.yy980); } - break; - case 385: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy957, &yymsp[-3].minor.yy561, &yymsp[0].minor.yy561, yymsp[-2].minor.yy844); } - break; - case 386: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy957, &yymsp[-4].minor.yy561, yymsp[-1].minor.yy980, yymsp[-3].minor.yy844, yymsp[0].minor.yy980); } - break; - case 387: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy561); } - break; - case 388: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy957, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561); } - break; - case 389: /* cmd ::= DESC full_table_name */ - case 390: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==390); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy980); } - break; - case 391: /* cmd ::= RESET QUERY CACHE */ -{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } - break; - case 392: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - case 393: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==393); -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy957, yymsp[-1].minor.yy980, yymsp[0].minor.yy980); } - break; - case 396: /* explain_options ::= */ -{ yymsp[1].minor.yy980 = createDefaultExplainOptions(pCxt); } - break; - case 397: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy980 = setExplainVerbose(pCxt, yymsp[-2].minor.yy980, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 398: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy980 = setExplainRatio(pCxt, yymsp[-2].minor.yy980, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 399: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy957, yymsp[-9].minor.yy957, &yymsp[-6].minor.yy561, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy896, yymsp[-1].minor.yy844, &yymsp[0].minor.yy561, yymsp[-10].minor.yy957); } - break; - case 400: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy561); } - break; - case 405: /* language_opt ::= */ - case 451: /* on_vgroup_id ::= */ yytestcase(yyruleno==451); -{ yymsp[1].minor.yy561 = nil_token; } - break; - case 406: /* language_opt ::= LANGUAGE NK_STRING */ - case 452: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==452); -{ yymsp[-1].minor.yy561 = yymsp[0].minor.yy0; } - break; - case 409: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy957, yymsp[-2].minor.yy980, &yymsp[-1].minor.yy0, yymsp[0].minor.yy980); } - break; - case 410: /* cmd ::= DROP VIEW exists_opt full_view_name */ -{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy957, yymsp[0].minor.yy980); } - break; - case 411: /* full_view_name ::= view_name */ -{ yylhsminor.yy980 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy561); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 412: /* full_view_name ::= db_name NK_DOT view_name */ -{ yylhsminor.yy980 = createViewNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 413: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy957, &yymsp[-8].minor.yy561, yymsp[-5].minor.yy980, yymsp[-7].minor.yy980, yymsp[-3].minor.yy628, yymsp[-2].minor.yy980, yymsp[0].minor.yy980, yymsp[-4].minor.yy628); } - break; - case 414: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy561); } - break; - case 415: /* cmd ::= PAUSE STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy561); } - break; - case 416: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ -{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy957, yymsp[-1].minor.yy957, &yymsp[0].minor.yy561); } - break; - case 421: /* column_stream_def ::= column_name stream_col_options */ -{ yylhsminor.yy980 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy561, createDataType(TSDB_DATA_TYPE_NULL), yymsp[0].minor.yy980); } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 422: /* stream_col_options ::= */ - case 783: /* column_options ::= */ yytestcase(yyruleno==783); -{ yymsp[1].minor.yy980 = createDefaultColumnOptions(pCxt); } - break; - case 423: /* stream_col_options ::= stream_col_options PRIMARY KEY */ - case 784: /* column_options ::= column_options PRIMARY KEY */ yytestcase(yyruleno==784); -{ yylhsminor.yy980 = setColumnOptionsPK(pCxt, yymsp[-2].minor.yy980); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 428: /* stream_options ::= stream_options TRIGGER AT_ONCE */ - case 429: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==429); - case 430: /* stream_options ::= stream_options TRIGGER FORCE_WINDOW_CLOSE */ yytestcase(yyruleno==430); -{ yylhsminor.yy980 = setStreamOptions(pCxt, yymsp[-2].minor.yy980, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 431: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ yylhsminor.yy980 = setStreamOptions(pCxt, yymsp[-3].minor.yy980, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy980)); } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 432: /* stream_options ::= stream_options WATERMARK duration_literal */ -{ yylhsminor.yy980 = setStreamOptions(pCxt, yymsp[-2].minor.yy980, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy980)); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 433: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ yylhsminor.yy980 = setStreamOptions(pCxt, yymsp[-3].minor.yy980, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 434: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ yylhsminor.yy980 = setStreamOptions(pCxt, yymsp[-2].minor.yy980, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 435: /* stream_options ::= stream_options DELETE_MARK duration_literal */ -{ yylhsminor.yy980 = setStreamOptions(pCxt, yymsp[-2].minor.yy980, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy980)); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 436: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ -{ yylhsminor.yy980 = setStreamOptions(pCxt, yymsp[-3].minor.yy980, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 438: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 727: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==727); - case 751: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==751); -{ yymsp[-3].minor.yy980 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy980); } - break; - case 441: /* cmd ::= KILL CONNECTION NK_INTEGER */ -{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } - break; - case 442: /* cmd ::= KILL QUERY NK_STRING */ -{ pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } - break; - case 443: /* cmd ::= KILL TRANSACTION NK_INTEGER */ -{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } - break; - case 444: /* cmd ::= KILL COMPACT NK_INTEGER */ -{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &yymsp[0].minor.yy0); } - break; - case 445: /* cmd ::= BALANCE VGROUP */ -{ pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } - break; - case 446: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ -{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy561); } - break; - case 447: /* cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ -{ pCxt->pRootNode = createBalanceVgroupLeaderDBNameStmt(pCxt, &yymsp[0].minor.yy561); } - break; - case 448: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ -{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } - break; - case 449: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy628); } - break; - case 450: /* cmd ::= SPLIT VGROUP NK_INTEGER */ -{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } - break; - case 453: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy628 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - break; - case 455: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy980, yymsp[0].minor.yy980); } - break; - case 458: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ yymsp[-6].minor.yy980 = createInsertStmt(pCxt, yymsp[-4].minor.yy980, yymsp[-2].minor.yy628, yymsp[0].minor.yy980); } - break; - case 459: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -{ yymsp[-3].minor.yy980 = createInsertStmt(pCxt, yymsp[-1].minor.yy980, NULL, yymsp[0].minor.yy980); } - break; - case 460: /* tags_literal ::= NK_INTEGER */ - case 472: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==472); - case 481: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==481); -{ yylhsminor.yy980 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 461: /* tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - case 462: /* tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==462); - case 473: /* tags_literal ::= NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==473); - case 474: /* tags_literal ::= NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==474); - case 482: /* tags_literal ::= NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==482); - case 483: /* tags_literal ::= NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==483); - case 491: /* tags_literal ::= NK_STRING NK_PLUS duration_literal */ yytestcase(yyruleno==491); - case 492: /* tags_literal ::= NK_STRING NK_MINUS duration_literal */ yytestcase(yyruleno==492); -{ - SToken l = yymsp[-2].minor.yy0; - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - l.n = (r.z + r.n) - l.z; - yylhsminor.yy980 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy980); - } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 463: /* tags_literal ::= NK_PLUS NK_INTEGER */ - case 466: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==466); - case 475: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==475); - case 478: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==478); - case 484: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==484); - case 487: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==487); -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy980 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); - } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 464: /* tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - case 465: /* tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==465); - case 467: /* tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ yytestcase(yyruleno==467); - case 468: /* tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==468); - case 476: /* tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==476); - case 477: /* tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==477); - case 479: /* tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==479); - case 480: /* tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==480); - case 485: /* tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==485); - case 486: /* tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==486); - case 488: /* tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==488); - case 489: /* tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==489); -{ - SToken l = yymsp[-3].minor.yy0; - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - l.n = (r.z + r.n) - l.z; - yylhsminor.yy980 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy980); - } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 469: /* tags_literal ::= NK_FLOAT */ -{ yylhsminor.yy980 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 470: /* tags_literal ::= NK_PLUS NK_FLOAT */ - case 471: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==471); -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy980 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); - } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 490: /* tags_literal ::= NK_STRING */ -{ yylhsminor.yy980 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 493: /* tags_literal ::= NK_BOOL */ -{ yylhsminor.yy980 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 494: /* tags_literal ::= NULL */ -{ yylhsminor.yy980 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 495: /* tags_literal ::= literal_func */ -{ yylhsminor.yy980 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy980); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 496: /* tags_literal ::= literal_func NK_PLUS duration_literal */ - case 497: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==497); -{ - SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy980); - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - l.n = (r.z + r.n) - l.z; - yylhsminor.yy980 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy980, yymsp[0].minor.yy980); - } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 500: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy980 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 501: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy980 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 502: /* literal ::= NK_STRING */ -{ yylhsminor.yy980 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 503: /* literal ::= NK_BOOL */ -{ yylhsminor.yy980 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 504: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 505: /* literal ::= duration_literal */ - case 515: /* signed_literal ::= signed */ yytestcase(yyruleno==515); - case 539: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==539); - case 540: /* expression ::= literal */ yytestcase(yyruleno==540); - case 542: /* expression ::= column_reference */ yytestcase(yyruleno==542); - case 543: /* expression ::= function_expression */ yytestcase(yyruleno==543); - case 544: /* expression ::= case_when_expression */ yytestcase(yyruleno==544); - case 590: /* function_expression ::= literal_func */ yytestcase(yyruleno==590); - case 591: /* function_expression ::= rand_func */ yytestcase(yyruleno==591); - case 649: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==649); - case 653: /* boolean_primary ::= predicate */ yytestcase(yyruleno==653); - case 655: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==655); - case 656: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==656); - case 659: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==659); - case 661: /* table_reference ::= table_primary */ yytestcase(yyruleno==661); - case 662: /* table_reference ::= joined_table */ yytestcase(yyruleno==662); - case 666: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==666); - case 753: /* query_simple ::= query_specification */ yytestcase(yyruleno==753); - case 754: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==754); - case 757: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==757); - case 759: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==759); -{ yylhsminor.yy980 = yymsp[0].minor.yy980; } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 506: /* literal ::= NULL */ -{ yylhsminor.yy980 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 507: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy980 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 508: /* duration_literal ::= NK_VARIABLE */ - case 728: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==728); - case 729: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==729); - case 730: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==730); -{ yylhsminor.yy980 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 509: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy980 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 510: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy980 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - break; - case 511: /* signed ::= NK_MINUS NK_INTEGER */ -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy980 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); - } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 512: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy980 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 513: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy980 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - break; - case 514: /* signed ::= NK_MINUS NK_FLOAT */ -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy980 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); - } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 516: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy980 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 517: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy980 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 518: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy980 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } - break; - case 519: /* signed_literal ::= duration_literal */ - case 521: /* signed_literal ::= literal_func */ yytestcase(yyruleno==521); - case 620: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==620); - case 703: /* select_item ::= common_expression */ yytestcase(yyruleno==703); - case 713: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==713); - case 758: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==758); - case 760: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==760); - case 773: /* search_condition ::= common_expression */ yytestcase(yyruleno==773); -{ yylhsminor.yy980 = releaseRawExprNode(pCxt, yymsp[0].minor.yy980); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 520: /* signed_literal ::= NULL */ -{ yylhsminor.yy980 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 522: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy980 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 541: /* expression ::= pseudo_column */ -{ yylhsminor.yy980 = yymsp[0].minor.yy980; (void)setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy980, true); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 545: /* expression ::= NK_LP expression NK_RP */ - case 654: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==654); - case 772: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==772); -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy980)); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 546: /* expression ::= NK_PLUS expr_or_subquery */ -{ - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy980)); - } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 547: /* expression ::= NK_MINUS expr_or_subquery */ -{ - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy980), NULL)); - } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 548: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy980); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), releaseRawExprNode(pCxt, yymsp[0].minor.yy980))); - } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 549: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy980); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), releaseRawExprNode(pCxt, yymsp[0].minor.yy980))); - } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 550: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy980); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), releaseRawExprNode(pCxt, yymsp[0].minor.yy980))); - } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 551: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy980); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), releaseRawExprNode(pCxt, yymsp[0].minor.yy980))); - } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 552: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy980); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), releaseRawExprNode(pCxt, yymsp[0].minor.yy980))); - } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 553: /* expression ::= column_reference NK_ARROW NK_STRING */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); - } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 554: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy980); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), releaseRawExprNode(pCxt, yymsp[0].minor.yy980))); - } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 555: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy980); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), releaseRawExprNode(pCxt, yymsp[0].minor.yy980))); - } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 558: /* column_reference ::= column_name */ -{ yylhsminor.yy980 = createRawExprNode(pCxt, &yymsp[0].minor.yy561, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy561)); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 559: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561, createColumnNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561)); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 560: /* column_reference ::= NK_ALIAS */ -{ yylhsminor.yy980 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 561: /* column_reference ::= table_name NK_DOT NK_ALIAS */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 562: /* pseudo_column ::= ROWTS */ - case 563: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==563); - case 565: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==565); - case 566: /* pseudo_column ::= QEND */ yytestcase(yyruleno==566); - case 567: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==567); - case 568: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==568); - case 569: /* pseudo_column ::= WEND */ yytestcase(yyruleno==569); - case 570: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==570); - case 571: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==571); - case 572: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==572); - case 573: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==573); - case 574: /* pseudo_column ::= FLOW */ yytestcase(yyruleno==574); - case 575: /* pseudo_column ::= FHIGH */ yytestcase(yyruleno==575); - case 576: /* pseudo_column ::= FROWTS */ yytestcase(yyruleno==576); - case 593: /* literal_func ::= NOW */ yytestcase(yyruleno==593); - case 594: /* literal_func ::= TODAY */ yytestcase(yyruleno==594); -{ yylhsminor.yy980 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 564: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy561)))); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 577: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 578: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==578); - case 586: /* function_expression ::= substr_func NK_LP expression_list NK_RP */ yytestcase(yyruleno==586); -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy561, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy561, yymsp[-1].minor.yy628)); } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 579: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - case 580: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ yytestcase(yyruleno==580); -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), yymsp[-1].minor.yy896)); } - yymsp[-5].minor.yy980 = yylhsminor.yy980; - break; - case 581: /* function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createPositionFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), releaseRawExprNode(pCxt, yymsp[-1].minor.yy980))); } - yymsp[-5].minor.yy980 = yylhsminor.yy980; - break; - case 582: /* function_expression ::= TRIM NK_LP expr_or_subquery NK_RP */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy980), TRIM_TYPE_BOTH)); } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 583: /* function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy980), yymsp[-3].minor.yy840)); } - yymsp[-5].minor.yy980 = yylhsminor.yy980; - break; - case 584: /* function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), releaseRawExprNode(pCxt, yymsp[-1].minor.yy980), TRIM_TYPE_BOTH)); } - yymsp[-5].minor.yy980 = yylhsminor.yy980; - break; - case 585: /* function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-6].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), releaseRawExprNode(pCxt, yymsp[-1].minor.yy980), yymsp[-4].minor.yy840)); } - yymsp[-6].minor.yy980 = yylhsminor.yy980; - break; - case 587: /* function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy561, &yymsp[0].minor.yy0, createSubstrFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), releaseRawExprNode(pCxt, yymsp[-1].minor.yy980))); } - yymsp[-5].minor.yy980 = yylhsminor.yy980; - break; - case 588: /* function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-7].minor.yy561, &yymsp[0].minor.yy0, createSubstrFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy980), releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), releaseRawExprNode(pCxt, yymsp[-1].minor.yy980))); } - yymsp[-7].minor.yy980 = yylhsminor.yy980; - break; - case 589: /* function_expression ::= REPLACE NK_LP expression_list NK_RP */ - case 596: /* rand_func ::= RAND NK_LP expression_list NK_RP */ yytestcase(yyruleno==596); -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy628)); } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 592: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy561, NULL)); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 595: /* rand_func ::= RAND NK_LP NK_RP */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy0, NULL)); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 599: /* trim_specification_type ::= BOTH */ -{ yymsp[0].minor.yy840 = TRIM_TYPE_BOTH; } - break; - case 600: /* trim_specification_type ::= TRAILING */ -{ yymsp[0].minor.yy840 = TRIM_TYPE_TRAILING; } - break; - case 601: /* trim_specification_type ::= LEADING */ -{ yymsp[0].minor.yy840 = TRIM_TYPE_LEADING; } - break; - case 616: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy628 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy628 = yylhsminor.yy628; - break; - case 621: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 706: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==706); -{ yylhsminor.yy980 = createColumnNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 622: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy628, yymsp[-1].minor.yy980)); } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 623: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), yymsp[-2].minor.yy628, yymsp[-1].minor.yy980)); } - yymsp[-4].minor.yy980 = yylhsminor.yy980; - break; - case 626: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy980 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), releaseRawExprNode(pCxt, yymsp[0].minor.yy980)); } - break; - case 628: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy980 = releaseRawExprNode(pCxt, yymsp[0].minor.yy980); } - break; - case 629: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 634: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==634); -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy980); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy688, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), releaseRawExprNode(pCxt, yymsp[0].minor.yy980))); - } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 630: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy980); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy980), releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), releaseRawExprNode(pCxt, yymsp[0].minor.yy980))); - } - yymsp[-4].minor.yy980 = yylhsminor.yy980; - break; - case 631: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy980); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy980), releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), releaseRawExprNode(pCxt, yymsp[0].minor.yy980))); - } - yymsp[-5].minor.yy980 = yylhsminor.yy980; - break; - case 632: /* predicate ::= expr_or_subquery IS NULL */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), NULL)); - } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 633: /* predicate ::= expr_or_subquery IS NOT NULL */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), NULL)); - } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 635: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy688 = OP_TYPE_LOWER_THAN; } - break; - case 636: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy688 = OP_TYPE_GREATER_THAN; } - break; - case 637: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy688 = OP_TYPE_LOWER_EQUAL; } - break; - case 638: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy688 = OP_TYPE_GREATER_EQUAL; } - break; - case 639: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy688 = OP_TYPE_NOT_EQUAL; } - break; - case 640: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy688 = OP_TYPE_EQUAL; } - break; - case 641: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy688 = OP_TYPE_LIKE; } - break; - case 642: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy688 = OP_TYPE_NOT_LIKE; } - break; - case 643: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy688 = OP_TYPE_MATCH; } - break; - case 644: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy688 = OP_TYPE_NMATCH; } - break; - case 645: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy688 = OP_TYPE_JSON_CONTAINS; } - break; - case 646: /* in_op ::= IN */ -{ yymsp[0].minor.yy688 = OP_TYPE_IN; } - break; - case 647: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy688 = OP_TYPE_NOT_IN; } - break; - case 648: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy628)); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 650: /* boolean_value_expression ::= NOT boolean_primary */ -{ - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy980), NULL)); - } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 651: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy980); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), releaseRawExprNode(pCxt, yymsp[0].minor.yy980))); - } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 652: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy980); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy980); - yylhsminor.yy980 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), releaseRawExprNode(pCxt, yymsp[0].minor.yy980))); - } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 660: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy980 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy980, yymsp[0].minor.yy980, NULL); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 663: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy980 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy561, &yymsp[0].minor.yy561); } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 664: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy980 = createRealTableNode(pCxt, &yymsp[-3].minor.yy561, &yymsp[-1].minor.yy561, &yymsp[0].minor.yy561); } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 665: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy980 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy980), &yymsp[0].minor.yy561); } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 667: /* alias_opt ::= */ -{ yymsp[1].minor.yy561 = nil_token; } - break; - case 669: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy561 = yymsp[0].minor.yy561; } - break; - case 670: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 671: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==671); -{ yymsp[-2].minor.yy980 = yymsp[-1].minor.yy980; } - break; - case 672: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ -{ - yylhsminor.yy980 = createJoinTableNode(pCxt, yymsp[-6].minor.yy652, yymsp[-5].minor.yy606, yymsp[-7].minor.yy980, yymsp[-3].minor.yy980, yymsp[-2].minor.yy980); - yylhsminor.yy980 = addWindowOffsetClause(pCxt, yylhsminor.yy980, yymsp[-1].minor.yy980); - yylhsminor.yy980 = addJLimitClause(pCxt, yylhsminor.yy980, yymsp[0].minor.yy980); - } - yymsp[-7].minor.yy980 = yylhsminor.yy980; - break; - case 673: /* join_type ::= */ -{ yymsp[1].minor.yy652 = JOIN_TYPE_INNER; } - break; - case 674: /* join_type ::= INNER */ -{ yymsp[0].minor.yy652 = JOIN_TYPE_INNER; } - break; - case 675: /* join_type ::= LEFT */ -{ yymsp[0].minor.yy652 = JOIN_TYPE_LEFT; } - break; - case 676: /* join_type ::= RIGHT */ -{ yymsp[0].minor.yy652 = JOIN_TYPE_RIGHT; } - break; - case 677: /* join_type ::= FULL */ -{ yymsp[0].minor.yy652 = JOIN_TYPE_FULL; } - break; - case 678: /* join_subtype ::= */ -{ yymsp[1].minor.yy606 = JOIN_STYPE_NONE; } - break; - case 679: /* join_subtype ::= OUTER */ -{ yymsp[0].minor.yy606 = JOIN_STYPE_OUTER; } - break; - case 680: /* join_subtype ::= SEMI */ -{ yymsp[0].minor.yy606 = JOIN_STYPE_SEMI; } - break; - case 681: /* join_subtype ::= ANTI */ -{ yymsp[0].minor.yy606 = JOIN_STYPE_ANTI; } - break; - case 682: /* join_subtype ::= ASOF */ -{ yymsp[0].minor.yy606 = JOIN_STYPE_ASOF; } - break; - case 683: /* join_subtype ::= WINDOW */ -{ yymsp[0].minor.yy606 = JOIN_STYPE_WIN; } - break; - case 687: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ -{ yymsp[-5].minor.yy980 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), releaseRawExprNode(pCxt, yymsp[-1].minor.yy980)); } - break; - case 688: /* window_offset_literal ::= NK_VARIABLE */ -{ yylhsminor.yy980 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 689: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */ -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy980 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t)); - } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 691: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - case 764: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==764); - case 768: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==768); -{ yymsp[-1].minor.yy980 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } - break; - case 692: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ -{ - yymsp[-13].minor.yy980 = createSelectStmt(pCxt, yymsp[-11].minor.yy957, yymsp[-9].minor.yy628, yymsp[-8].minor.yy980, yymsp[-12].minor.yy628); - yymsp[-13].minor.yy980 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy980, yymsp[-10].minor.yy957); - yymsp[-13].minor.yy980 = addWhereClause(pCxt, yymsp[-13].minor.yy980, yymsp[-7].minor.yy980); - yymsp[-13].minor.yy980 = addPartitionByClause(pCxt, yymsp[-13].minor.yy980, yymsp[-6].minor.yy628); - yymsp[-13].minor.yy980 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy980, yymsp[-2].minor.yy980); - yymsp[-13].minor.yy980 = addGroupByClause(pCxt, yymsp[-13].minor.yy980, yymsp[-1].minor.yy628); - yymsp[-13].minor.yy980 = addHavingClause(pCxt, yymsp[-13].minor.yy980, yymsp[0].minor.yy980); - yymsp[-13].minor.yy980 = addRangeClause(pCxt, yymsp[-13].minor.yy980, yymsp[-5].minor.yy980); - yymsp[-13].minor.yy980 = addEveryClause(pCxt, yymsp[-13].minor.yy980, yymsp[-4].minor.yy980); - yymsp[-13].minor.yy980 = addFillClause(pCxt, yymsp[-13].minor.yy980, yymsp[-3].minor.yy980); - } - break; - case 693: /* hint_list ::= */ -{ yymsp[1].minor.yy628 = createHintNodeList(pCxt, NULL); } - break; - case 694: /* hint_list ::= NK_HINT */ -{ yylhsminor.yy628 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy628 = yylhsminor.yy628; - break; - case 699: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy957 = false; } - break; - case 702: /* select_item ::= NK_STAR */ -{ yylhsminor.yy980 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy980 = yylhsminor.yy980; - break; - case 704: /* select_item ::= common_expression column_alias */ - case 714: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==714); -{ yylhsminor.yy980 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy980), &yymsp[0].minor.yy561); } - yymsp[-1].minor.yy980 = yylhsminor.yy980; - break; - case 705: /* select_item ::= common_expression AS column_alias */ - case 715: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==715); -{ yylhsminor.yy980 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), &yymsp[0].minor.yy561); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 710: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 742: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==742); - case 762: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==762); -{ yymsp[-2].minor.yy628 = yymsp[0].minor.yy628; } - break; - case 717: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ -{ yymsp[-5].minor.yy980 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), releaseRawExprNode(pCxt, yymsp[-1].minor.yy980)); } - break; - case 718: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy980 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy980)); } - break; - case 719: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy980 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), NULL, yymsp[-1].minor.yy980, yymsp[0].minor.yy980); } - break; - case 720: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy980 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy980), releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), yymsp[-1].minor.yy980, yymsp[0].minor.yy980); } - break; - case 721: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -{ yymsp[-6].minor.yy980 = createEventWindowNode(pCxt, yymsp[-3].minor.yy980, yymsp[0].minor.yy980); } - break; - case 722: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy980 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } - break; - case 723: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy980 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } - break; - case 724: /* twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy980 = createAnomalyWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy980), NULL); } - break; - case 725: /* twindow_clause_opt ::= ANOMALY_WINDOW NK_LP expr_or_subquery NK_COMMA NK_STRING NK_RP */ -{ yymsp[-5].minor.yy980 = createAnomalyWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), &yymsp[-1].minor.yy0); } - break; - case 732: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy980 = createFillNode(pCxt, yymsp[-1].minor.yy690, NULL); } - break; - case 733: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy980 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy628)); } - break; - case 734: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy980 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy628)); } - break; - case 735: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy690 = FILL_MODE_NONE; } - break; - case 736: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy690 = FILL_MODE_PREV; } - break; - case 737: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy690 = FILL_MODE_NULL; } - break; - case 738: /* fill_mode ::= NULL_F */ -{ yymsp[0].minor.yy690 = FILL_MODE_NULL_F; } - break; - case 739: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy690 = FILL_MODE_LINEAR; } - break; - case 740: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy690 = FILL_MODE_NEXT; } - break; - case 743: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy628 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy980))); } - yymsp[0].minor.yy628 = yylhsminor.yy628; - break; - case 744: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy628 = addNodeToList(pCxt, yymsp[-2].minor.yy628, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy980))); } - yymsp[-2].minor.yy628 = yylhsminor.yy628; - break; - case 748: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy980 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy980), releaseRawExprNode(pCxt, yymsp[-1].minor.yy980)); } - break; - case 749: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy980 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy980)); } - break; - case 752: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ -{ - yylhsminor.yy980 = addOrderByClause(pCxt, yymsp[-3].minor.yy980, yymsp[-2].minor.yy628); - yylhsminor.yy980 = addSlimitClause(pCxt, yylhsminor.yy980, yymsp[-1].minor.yy980); - yylhsminor.yy980 = addLimitClause(pCxt, yylhsminor.yy980, yymsp[0].minor.yy980); - } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 755: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy980 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy980, yymsp[0].minor.yy980); } - yymsp[-3].minor.yy980 = yylhsminor.yy980; - break; - case 756: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy980 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy980, yymsp[0].minor.yy980); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 765: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 769: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==769); -{ yymsp[-3].minor.yy980 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } - break; - case 766: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 770: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==770); -{ yymsp[-3].minor.yy980 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } - break; - case 771: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy980 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy980); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 776: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy980 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy980), yymsp[-1].minor.yy274, yymsp[0].minor.yy305); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - case 777: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy274 = ORDER_ASC; } - break; - case 778: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy274 = ORDER_ASC; } - break; - case 779: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy274 = ORDER_DESC; } - break; - case 780: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy305 = NULL_ORDER_DEFAULT; } - break; - case 781: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy305 = NULL_ORDER_FIRST; } - break; - case 782: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy305 = NULL_ORDER_LAST; } - break; - case 785: /* column_options ::= column_options NK_ID NK_STRING */ -{ yylhsminor.yy980 = setColumnOptions(pCxt, yymsp[-2].minor.yy980, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy980 = yylhsminor.yy980; - break; - default: - break; -/********** End reduce actions ************************************************/ - }; - assert( yyrulenoYY_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 */ -){ - ParseARG_FETCH - ParseCTX_FETCH -#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 *****************************************/ - ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ - ParseCTX_STORE -} -#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 */ - ParseTOKENTYPE yyminor /* The minor type of the error token */ -){ - ParseARG_FETCH - ParseCTX_FETCH -#define TOKEN yyminor -/************ Begin %syntax_error code ****************************************/ - - if (TSDB_CODE_SUCCESS == pCxt->errCode) { - if(TOKEN.z) { - pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z); - } else { - pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL); - } - } else if (TSDB_CODE_PAR_DB_NOT_SPECIFIED == pCxt->errCode && TK_NK_FLOAT == TOKEN.type) { - pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z); - } -/************ End %syntax_error code ******************************************/ - ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ - ParseCTX_STORE -} - -/* -** The following is executed when the parser accepts -*/ -static void yy_accept( - yyParser *yypParser /* The parser */ -){ - ParseARG_FETCH - ParseCTX_FETCH -#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 *******************************************/ - ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ - ParseCTX_STORE -} - -/* The main parser program. -** The first argument is a pointer to a structure obtained from -** "ParseAlloc" which describes the current state of the parser. -** 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: -**
    -**
  • A pointer to the parser (an opaque structure.) -**
  • The major token number. -**
  • The minor token number. -**
  • An option argument of a grammar-specified type. -**
-** -** Outputs: -** None. -*/ -void Parse( - void *yyp, /* The parser */ - int yymajor, /* The major token code number */ - ParseTOKENTYPE yyminor /* The value for the token */ - ParseARG_PDECL /* Optional %extra_argument parameter */ -){ - 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 */ - ParseCTX_FETCH - ParseARG_STORE - - 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 - - while(1){ /* Exit by "break" */ - assert( yypParser->yytos>=yypParser->yystack ); - assert( yyact==yypParser->yytos->stateno ); - yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact); - if( yyact >= YY_MIN_REDUCE ){ - unsigned int yyruleno = yyact - YY_MIN_REDUCE; /* Reduce by this rule */ -#ifndef NDEBUG - assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ); - if( yyTraceFILE ){ - int yysize = yyRuleInfoNRhs[yyruleno]; - if( yysize ){ - fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", - yyTracePrompt, - yyruleno, yyRuleName[yyruleno], - yyrulenoyytos[yysize].stateno); - }else{ - fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n", - yyTracePrompt, yyruleno, yyRuleName[yyruleno], - yyrulenoyytos - 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); - break; - } -#else - if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ - if( yyGrowStack(yypParser) ){ - yyStackOverflow(yypParser); - break; - } - } -#endif - } - yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor ParseCTX_PARAM); - }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); - if( yyact<=YY_MAX_SHIFTREDUCE ) break; - 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 - } - } -#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. -*/ -int ParseFallback(int iToken){ -#ifdef YYFALLBACK - assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ); - return yyFallback[iToken]; -#else - (void)iToken; - return 0; -#endif -}