1 /* Driver template for the LEMON parser generator.
2 ** The author disclaims copyright to this source code.
3 */
4 /* First off, code is included that follows the "include" declaration
5 ** in the input grammar file. */
6 #include <stdio.h>
7 #line 36 "./delimiter.y"
8 
9 #include <string.h>
10 #include <glib.h>
11 #include <glib-object.h>
12 #include <glib/gi18n-lib.h>
13 #include <libgda/sql-parser/gda-sql-parser-private.h>
14 #include <libgda/sql-parser/gda-statement-struct-util.h>
15 #include <libgda/sql-parser/gda-statement-struct-unknown.h>
16 #include <libgda/sql-parser/gda-statement-struct-parts.h>
17 #include <assert.h>
18 #line 19 "delimiter.c"
19 /* Next is all token values, in a form suitable for use by makeheaders.
20 ** This section will be null unless lemon is run with the -m switch.
21 */
22 /*
23 ** These constants (all generated automatically by the parser generator)
24 ** specify the various kinds of tokens (terminals) that the parser
25 ** understands.
26 **
27 ** Each symbol here is a terminal symbol in the grammar.
28 */
29 /* Make sure the INTERFACE macro is defined.
30 */
31 #ifndef INTERFACE
32 # define INTERFACE 1
33 #endif
34 /* The next thing included is series of defines which control
35 ** various aspects of the generated parser.
36 **    YYCODETYPE         is the data type used for storing terminal
37 **                       and nonterminal numbers.  "unsigned char" is
38 **                       used if there are fewer than 250 terminals
39 **                       and nonterminals.  "int" is used otherwise.
40 **    YYNOCODE           is a number of type YYCODETYPE which corresponds
41 **                       to no legal terminal or nonterminal number.  This
42 **                       number is used to fill in empty slots of the hash
43 **                       table.
44 **    YYFALLBACK         If defined, this indicates that one or more tokens
45 **                       have fall-back values which should be used if the
46 **                       original value of the token will not parse.
47 **    YYACTIONTYPE       is the data type used for storing terminal
48 **                       and nonterminal numbers.  "unsigned char" is
49 **                       used if there are fewer than 250 rules and
50 **                       states combined.  "int" is used otherwise.
51 **    priv_gda_sql_delimiterTOKENTYPE     is the data type used for minor tokens given
52 **                       directly to the parser from the tokenizer.
53 **    YYMINORTYPE        is the data type used for all minor tokens.
54 **                       This is typically a union of many types, one of
55 **                       which is priv_gda_sql_delimiterTOKENTYPE.  The entry in the union
56 **                       for base tokens is called "yy0".
57 **    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
58 **                       zero the stack is dynamically sized using realloc()
59 **    priv_gda_sql_delimiterARG_SDECL     A static variable declaration for the %extra_argument
60 **    priv_gda_sql_delimiterARG_PDECL     A parameter declaration for the %extra_argument
61 **    priv_gda_sql_delimiterARG_STORE     Code to store %extra_argument into yypParser
62 **    priv_gda_sql_delimiterARG_FETCH     Code to extract %extra_argument from yypParser
63 **    YYNSTATE           the combined number of states.
64 **    YYNRULE            the number of rules in the grammar
65 **    YYERRORSYMBOL      is the code number of the error symbol.  If not
66 **                       defined, then do no error processing.
67 */
68 #define YYCODETYPE unsigned char
69 #define YYNOCODE 32
70 #define YYACTIONTYPE unsigned char
71 #define priv_gda_sql_delimiterTOKENTYPE GValue *
72 typedef union {
73   int yyinit;
74   priv_gda_sql_delimiterTOKENTYPE yy0;
75   GdaSqlParamSpec * yy3;
76   GSList * yy27;
77   GdaSqlStatement * yy28;
78   GdaSqlExpr * yy54;
79 } YYMINORTYPE;
80 #ifndef YYSTACKDEPTH
81 #define YYSTACKDEPTH 100
82 #endif
83 #define priv_gda_sql_delimiterARG_SDECL GdaSqlParserIface *pdata;
84 #define priv_gda_sql_delimiterARG_PDECL ,GdaSqlParserIface *pdata
85 #define priv_gda_sql_delimiterARG_FETCH GdaSqlParserIface *pdata = yypParser->pdata
86 #define priv_gda_sql_delimiterARG_STORE yypParser->pdata = pdata
87 #define YYNSTATE 26
88 #define YYNRULE 20
89 #define YYFALLBACK 1
90 #define YY_NO_ACTION      (YYNSTATE+YYNRULE+2)
91 #define YY_ACCEPT_ACTION  (YYNSTATE+YYNRULE+1)
92 #define YY_ERROR_ACTION   (YYNSTATE+YYNRULE)
93 
94 /* The yyzerominor constant is used to initialize instances of
95 ** YYMINORTYPE objects to zero. */
96 static const YYMINORTYPE yyzerominor = { 0 };
97 
98 /* Define the yytestcase() macro to be a no-op if is not already defined
99 ** otherwise.
100 **
101 ** Applications can choose to define yytestcase() in the %include section
102 ** to a macro that can assist in verifying code coverage.  For production
103 ** code the yytestcase() macro should be turned off.  But it is useful
104 ** for testing.
105 */
106 #ifndef yytestcase
107 # define yytestcase(X)
108 #endif
109 
110 
111 /* Next are the tables used to determine what action to take based on the
112 ** current state and lookahead token.  These tables are used to implement
113 ** functions that take a state number and lookahead value and return an
114 ** action integer.
115 **
116 ** Suppose the action integer is N.  Then the action is determined as
117 ** follows
118 **
119 **   0 <= N < YYNSTATE                  Shift N.  That is, push the lookahead
120 **                                      token onto the stack and goto state N.
121 **
122 **   YYNSTATE <= N < YYNSTATE+YYNRULE   Reduce by rule N-YYNSTATE.
123 **
124 **   N == YYNSTATE+YYNRULE              A syntax error has occurred.
125 **
126 **   N == YYNSTATE+YYNRULE+1            The parser accepts its input.
127 **
128 **   N == YYNSTATE+YYNRULE+2            No such action.  Denotes unused
129 **                                      slots in the yy_action[] table.
130 **
131 ** The action table is constructed as a single large table named yy_action[].
132 ** Given state S and lookahead X, the action is computed as
133 **
134 **      yy_action[ yy_shift_ofst[S] + X ]
135 **
136 ** If the index value yy_shift_ofst[S]+X is out of range or if the value
137 ** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
138 ** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
139 ** and that yy_default[S] should be used instead.
140 **
141 ** The formula above is for computing the action when the lookahead is
142 ** a terminal symbol.  If the lookahead is a non-terminal (as occurs after
143 ** a reduce action) then the yy_reduce_ofst[] array is used in place of
144 ** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
145 ** YY_SHIFT_USE_DFLT.
146 **
147 ** The following are the tables generated in this section:
148 **
149 **  yy_action[]        A single table containing all actions.
150 **  yy_lookahead[]     A table containing the lookahead for each entry in
151 **                     yy_action.  Used to detect hash collisions.
152 **  yy_shift_ofst[]    For each state, the offset into yy_action for
153 **                     shifting terminals.
154 **  yy_reduce_ofst[]   For each state, the offset into yy_action for
155 **                     shifting non-terminals after a reduce.
156 **  yy_default[]       Default action for each state.
157 */
158 #define YY_ACTTAB_COUNT (45)
159 static const YYACTIONTYPE yy_action[] = {
160  /*     0 */    23,   21,   26,   20,   19,   18,   17,   27,    9,    8,
161  /*    10 */    22,   16,   15,   14,   13,    6,   23,    3,   11,   12,
162  /*    20 */     2,   20,   19,   18,   17,    5,   22,   16,   15,   14,
163  /*    30 */    13,    6,   48,   48,   11,   47,    1,   10,   24,    7,
164  /*    40 */    25,   24,    7,   48,    4,
165 };
166 static const YYCODETYPE yy_lookahead[] = {
167  /*     0 */     1,   18,    0,   20,   21,   22,   23,    0,    9,   10,
168  /*    10 */    11,   12,   13,   14,   15,   16,    1,   17,   19,   18,
169  /*    20 */    17,   20,   21,   22,   23,   30,   11,   12,   13,   14,
170  /*    30 */    15,   16,   31,   31,   19,   25,   26,   27,   28,   29,
171  /*    40 */    27,   28,   29,   31,   30,
172 };
173 #define YY_SHIFT_USE_DFLT (-18)
174 #define YY_SHIFT_COUNT (9)
175 #define YY_SHIFT_MIN   (-17)
176 #define YY_SHIFT_MAX   (15)
177 static const signed char yy_shift_ofst[] = {
178  /*     0 */    15,   -1,  -18,  -18,    1,  -17,    3,    0,    7,    2,
179 };
180 #define YY_REDUCE_USE_DFLT (-6)
181 #define YY_REDUCE_COUNT (3)
182 #define YY_REDUCE_MIN   (-5)
183 #define YY_REDUCE_MAX   (14)
184 static const signed char yy_reduce_ofst[] = {
185  /*     0 */    10,   13,   14,   -5,
186 };
187 static const YYACTIONTYPE yy_default[] = {
188  /*     0 */    46,   46,   41,   41,   46,   46,   46,   33,   46,   46,
189  /*    10 */    29,   40,   38,   37,   36,   35,   34,   45,   44,   43,
190  /*    20 */    42,   39,   32,   31,   30,   28,
191 };
192 
193 /* The next table maps tokens into fallback tokens.  If a construct
194 ** like the following:
195 **
196 **      %fallback ID X Y Z.
197 **
198 ** appears in the grammar, then ID becomes a fallback token for X, Y,
199 ** and Z.  Whenever one of the tokens X, Y, or Z is input to the parser
200 ** but it does not parse, the type of the token is changed to ID and
201 ** the parse is retried before an error is thrown.
202 */
203 #ifdef YYFALLBACK
204 static const YYCODETYPE yyFallback[] = {
205     0,  /*          $ => nothing */
206     0,  /*  RAWSTRING => nothing */
207     1,  /*       LOOP => RAWSTRING */
208     1,  /*    ENDLOOP => RAWSTRING */
209     1,  /*    DECLARE => RAWSTRING */
210     1,  /*     CREATE => RAWSTRING */
211     1,  /*       BLOB => RAWSTRING */
212 };
213 #endif /* YYFALLBACK */
214 
215 /* The following structure represents a single element of the
216 ** parser's stack.  Information stored includes:
217 **
218 **   +  The state number for the parser at this level of the stack.
219 **
220 **   +  The value of the token stored at this level of the stack.
221 **      (In other words, the "major" token.)
222 **
223 **   +  The semantic value stored at this level of the stack.  This is
224 **      the information used by the action routines in the grammar.
225 **      It is sometimes called the "minor" token.
226 */
227 struct yyStackEntry {
228   YYACTIONTYPE stateno;  /* The state-number */
229   YYCODETYPE major;      /* The major token value.  This is the code
230                          ** number for the token at this stack level */
231   YYMINORTYPE minor;     /* The user-supplied minor token value.  This
232                          ** is the value of the token  */
233 };
234 typedef struct yyStackEntry yyStackEntry;
235 
236 /* The state of the parser is completely contained in an instance of
237 ** the following structure */
238 struct yyParser {
239   int yyidx;                    /* Index of top element in stack */
240 #ifdef YYTRACKMAXSTACKDEPTH
241   int yyidxMax;                 /* Maximum value of yyidx */
242 #endif
243   int yyerrcnt;                 /* Shifts left before out of the error */
244   priv_gda_sql_delimiterARG_SDECL                /* A place to hold %extra_argument */
245 #if YYSTACKDEPTH<=0
246   int yystksz;                  /* Current side of the stack */
247   yyStackEntry *yystack;        /* The parser's stack */
248 #else
249   yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
250 #endif
251 };
252 typedef struct yyParser yyParser;
253 
254 #ifndef NDEBUG
255 #include <stdio.h>
256 static FILE *yyTraceFILE = 0;
257 static char *yyTracePrompt = 0;
258 #endif /* NDEBUG */
259 
260 #ifndef NDEBUG
261 /*
262 ** Turn parser tracing on by giving a stream to which to write the trace
263 ** and a prompt to preface each trace message.  Tracing is turned off
264 ** by making either argument NULL
265 **
266 ** Inputs:
267 ** <ul>
268 ** <li> A FILE* to which trace output should be written.
269 **      If NULL, then tracing is turned off.
270 ** <li> A prefix string written at the beginning of every
271 **      line of trace output.  If NULL, then tracing is
272 **      turned off.
273 ** </ul>
274 **
275 ** Outputs:
276 ** None.
277 */
priv_gda_sql_delimiterTrace(FILE * TraceFILE,char * zTracePrompt)278 void priv_gda_sql_delimiterTrace(FILE *TraceFILE, char *zTracePrompt){
279   yyTraceFILE = TraceFILE;
280   yyTracePrompt = zTracePrompt;
281   if( yyTraceFILE==0 ) yyTracePrompt = 0;
282   else if( yyTracePrompt==0 ) yyTraceFILE = 0;
283 }
284 #endif /* NDEBUG */
285 
286 #ifndef NDEBUG
287 /* For tracing shifts, the names of all terminals and nonterminals
288 ** are required.  The following table supplies these names */
289 static const char *const yyTokenName[] = {
290   "$",             "RAWSTRING",     "LOOP",          "ENDLOOP",
291   "DECLARE",       "CREATE",        "BLOB",          "ILLEGAL",
292   "SQLCOMMENT",    "SEMI",          "END_OF_FILE",   "SPACE",
293   "STRING",        "TEXTUAL",       "INTEGER",       "FLOAT",
294   "UNSPECVAL",     "LSBRACKET",     "RSBRACKET",     "SIMPLEPARAM",
295   "PNAME",         "PDESCR",        "PTYPE",         "PNULLOK",
296   "error",         "stmt",          "exprlist",      "expr",
297   "pvalue",        "value",         "paramspec",
298 };
299 #endif /* NDEBUG */
300 
301 #ifndef NDEBUG
302 /* For tracing reduce actions, the names of all rules are required.
303 */
304 static const char *const yyRuleName[] = {
305  /*   0 */ "stmt ::= exprlist SEMI",
306  /*   1 */ "stmt ::= exprlist END_OF_FILE",
307  /*   2 */ "exprlist ::= exprlist expr",
308  /*   3 */ "exprlist ::= expr",
309  /*   4 */ "expr ::= pvalue",
310  /*   5 */ "expr ::= RAWSTRING",
311  /*   6 */ "expr ::= SPACE",
312  /*   7 */ "expr ::= value",
313  /*   8 */ "value ::= STRING",
314  /*   9 */ "value ::= TEXTUAL",
315  /*  10 */ "value ::= INTEGER",
316  /*  11 */ "value ::= FLOAT",
317  /*  12 */ "pvalue ::= UNSPECVAL LSBRACKET paramspec RSBRACKET",
318  /*  13 */ "pvalue ::= value LSBRACKET paramspec RSBRACKET",
319  /*  14 */ "pvalue ::= SIMPLEPARAM",
320  /*  15 */ "paramspec ::=",
321  /*  16 */ "paramspec ::= paramspec PNAME",
322  /*  17 */ "paramspec ::= paramspec PDESCR",
323  /*  18 */ "paramspec ::= paramspec PTYPE",
324  /*  19 */ "paramspec ::= paramspec PNULLOK",
325 };
326 #endif /* NDEBUG */
327 
328 
329 #if YYSTACKDEPTH<=0
330 /*
331 ** Try to increase the size of the parser stack.
332 */
yyGrowStack(yyParser * p)333 static void yyGrowStack(yyParser *p){
334   int newSize;
335   yyStackEntry *pNew;
336 
337   newSize = p->yystksz*2 + 100;
338   pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
339   if( pNew ){
340     p->yystack = pNew;
341     p->yystksz = newSize;
342 #ifndef NDEBUG
343     if( yyTraceFILE ){
344       fprintf(yyTraceFILE,"%sStack grows to %d entries!\n",
345               yyTracePrompt, p->yystksz);
346     }
347 #endif
348   }
349 }
350 #endif
351 
352 /*
353 ** This function allocates a new parser.
354 ** The only argument is a pointer to a function which works like
355 ** malloc.
356 **
357 ** Inputs:
358 ** A pointer to the function used to allocate memory.
359 **
360 ** Outputs:
361 ** A pointer to a parser.  This pointer is used in subsequent calls
362 ** to priv_gda_sql_delimiter and priv_gda_sql_delimiterFree.
363 */
priv_gda_sql_delimiterAlloc(void * (* mallocProc)(size_t))364 void *priv_gda_sql_delimiterAlloc(void *(*mallocProc)(size_t)){
365   yyParser *pParser;
366   pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
367   if( pParser ){
368     pParser->yyidx = -1;
369 #ifdef YYTRACKMAXSTACKDEPTH
370     pParser->yyidxMax = 0;
371 #endif
372 #if YYSTACKDEPTH<=0
373     pParser->yystack = NULL;
374     pParser->yystksz = 0;
375     yyGrowStack(pParser);
376 #endif
377   }
378   return pParser;
379 }
380 
381 /* The following function deletes the value associated with a
382 ** symbol.  The symbol can be either a terminal or nonterminal.
383 ** "yymajor" is the symbol code, and "yypminor" is a pointer to
384 ** the value.
385 */
yy_destructor(yyParser * yypParser,YYCODETYPE yymajor,YYMINORTYPE * yypminor)386 static void yy_destructor(
387   yyParser *yypParser,    /* The parser */
388   YYCODETYPE yymajor,     /* Type code for object to destroy */
389   YYMINORTYPE *yypminor   /* The object to be destroyed */
390 ){
391   priv_gda_sql_delimiterARG_FETCH;
392   switch( yymajor ){
393     /* Here is inserted the actions which take place when a
394     ** terminal or non-terminal is destroyed.  This can happen
395     ** when the symbol is popped from the stack during a
396     ** reduce or during error processing or when a parser is
397     ** being destroyed before it is finished parsing.
398     **
399     ** Note: during a reduce, the only symbols destroyed are those
400     ** which appear on the RHS of the rule, but which are not used
401     ** inside the C code.
402     */
403       /* TERMINAL Destructor */
404     case 1: /* RAWSTRING */
405     case 2: /* LOOP */
406     case 3: /* ENDLOOP */
407     case 4: /* DECLARE */
408     case 5: /* CREATE */
409     case 6: /* BLOB */
410     case 7: /* ILLEGAL */
411     case 8: /* SQLCOMMENT */
412     case 9: /* SEMI */
413     case 10: /* END_OF_FILE */
414     case 11: /* SPACE */
415     case 12: /* STRING */
416     case 13: /* TEXTUAL */
417     case 14: /* INTEGER */
418     case 15: /* FLOAT */
419     case 16: /* UNSPECVAL */
420     case 17: /* LSBRACKET */
421     case 18: /* RSBRACKET */
422     case 19: /* SIMPLEPARAM */
423     case 20: /* PNAME */
424     case 21: /* PDESCR */
425     case 22: /* PTYPE */
426     case 23: /* PNULLOK */
427 {
428 #line 9 "./delimiter.y"
429 if ((yypminor->yy0)) {
430 #ifdef GDA_DEBUG_NO
431                  gchar *str = gda_sql_value_stringify ((yypminor->yy0));
432                  g_print ("___ token destructor /%s/\n", str)
433                  g_free (str);
434 #endif
435 		 g_value_unset ((yypminor->yy0)); g_free ((yypminor->yy0));}
436 #line 437 "delimiter.c"
437 }
438       break;
439     case 25: /* stmt */
440 {
441 #line 61 "./delimiter.y"
442 g_print ("Statement destroyed by parser: %p\n", (yypminor->yy28)); gda_sql_statement_free ((yypminor->yy28));
443 #line 444 "delimiter.c"
444 }
445       break;
446     case 26: /* exprlist */
447 {
448 #line 73 "./delimiter.y"
449 if ((yypminor->yy27)) {g_slist_foreach ((yypminor->yy27), (GFunc) gda_sql_expr_free, NULL); g_slist_free ((yypminor->yy27));}
450 #line 451 "delimiter.c"
451 }
452       break;
453     case 27: /* expr */
454     case 28: /* pvalue */
455 {
456 #line 79 "./delimiter.y"
457 gda_sql_expr_free ((yypminor->yy54));
458 #line 459 "delimiter.c"
459 }
460       break;
461     case 30: /* paramspec */
462 {
463 #line 100 "./delimiter.y"
464 gda_sql_param_spec_free ((yypminor->yy3));
465 #line 466 "delimiter.c"
466 }
467       break;
468     default:  break;   /* If no destructor action specified: do nothing */
469   }
470 }
471 
472 /*
473 ** Pop the parser's stack once.
474 **
475 ** If there is a destructor routine associated with the token which
476 ** is popped from the stack, then call it.
477 **
478 ** Return the major token number for the symbol popped.
479 */
yy_pop_parser_stack(yyParser * pParser)480 static int yy_pop_parser_stack(yyParser *pParser){
481   YYCODETYPE yymajor;
482   yyStackEntry *yytos;
483 
484   if( pParser->yyidx<0 ) return 0;
485   yytos = &pParser->yystack[pParser->yyidx];
486 #ifndef NDEBUG
487   if( yyTraceFILE && pParser->yyidx>=0 ){
488     fprintf(yyTraceFILE,"%sPopping %s\n",
489       yyTracePrompt,
490       yyTokenName[yytos->major]);
491   }
492 #endif
493   yymajor = yytos->major;
494   yy_destructor(pParser, yymajor, &yytos->minor);
495   pParser->yyidx--;
496   return yymajor;
497 }
498 
499 /*
500 ** Deallocate and destroy a parser.  Destructors are all called for
501 ** all stack elements before shutting the parser down.
502 **
503 ** Inputs:
504 ** <ul>
505 ** <li>  A pointer to the parser.  This should be a pointer
506 **       obtained from priv_gda_sql_delimiterAlloc.
507 ** <li>  A pointer to a function used to reclaim memory obtained
508 **       from malloc.
509 ** </ul>
510 */
priv_gda_sql_delimiterFree(void * p,void (* freeProc)(void *))511 void priv_gda_sql_delimiterFree(
512   void *p,                    /* The parser to be deleted */
513   void (*freeProc)(void*)     /* Function used to reclaim memory */
514 ){
515   yyParser *pParser = (yyParser*)p;
516   if( pParser==0 ) return;
517   while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
518 #if YYSTACKDEPTH<=0
519   free(pParser->yystack);
520 #endif
521   (*freeProc)((void*)pParser);
522 }
523 
524 /*
525 ** Return the peak depth of the stack for a parser.
526 */
527 #ifdef YYTRACKMAXSTACKDEPTH
priv_gda_sql_delimiterStackPeak(void * p)528 int priv_gda_sql_delimiterStackPeak(void *p){
529   yyParser *pParser = (yyParser*)p;
530   return pParser->yyidxMax;
531 }
532 #endif
533 
534 /*
535 ** Find the appropriate action for a parser given the terminal
536 ** look-ahead token iLookAhead.
537 **
538 ** If the look-ahead token is YYNOCODE, then check to see if the action is
539 ** independent of the look-ahead.  If it is, return the action, otherwise
540 ** return YY_NO_ACTION.
541 */
yy_find_shift_action(yyParser * pParser,YYCODETYPE iLookAhead)542 static int yy_find_shift_action(
543   yyParser *pParser,        /* The parser */
544   YYCODETYPE iLookAhead     /* The look-ahead token */
545 ){
546   int i;
547   int stateno = pParser->yystack[pParser->yyidx].stateno;
548 
549   if( stateno>YY_SHIFT_COUNT
550    || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
551     return yy_default[stateno];
552   }
553   assert( iLookAhead!=YYNOCODE );
554   i += iLookAhead;
555   if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
556     if( iLookAhead>0 ){
557 #ifdef YYFALLBACK
558       YYCODETYPE iFallback;            /* Fallback token */
559       if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
560              && (iFallback = yyFallback[iLookAhead])!=0 ){
561 #ifndef NDEBUG
562         if( yyTraceFILE ){
563           fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
564              yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
565         }
566 #endif
567         return yy_find_shift_action(pParser, iFallback);
568       }
569 #endif
570 #ifdef YYWILDCARD
571       {
572         int j = i - iLookAhead + YYWILDCARD;
573         if(
574 #if YY_SHIFT_MIN+YYWILDCARD<0
575           j>=0 &&
576 #endif
577 #if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
578           j<YY_ACTTAB_COUNT &&
579 #endif
580           yy_lookahead[j]==YYWILDCARD
581         ){
582 #ifndef NDEBUG
583           if( yyTraceFILE ){
584             fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
585                yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]);
586           }
587 #endif /* NDEBUG */
588           return yy_action[j];
589         }
590       }
591 #endif /* YYWILDCARD */
592     }
593     return yy_default[stateno];
594   }else{
595     return yy_action[i];
596   }
597 }
598 
599 /*
600 ** Find the appropriate action for a parser given the non-terminal
601 ** look-ahead token iLookAhead.
602 **
603 ** If the look-ahead token is YYNOCODE, then check to see if the action is
604 ** independent of the look-ahead.  If it is, return the action, otherwise
605 ** return YY_NO_ACTION.
606 */
yy_find_reduce_action(int stateno,YYCODETYPE iLookAhead)607 static int yy_find_reduce_action(
608   int stateno,              /* Current state number */
609   YYCODETYPE iLookAhead     /* The look-ahead token */
610 ){
611   int i;
612 #ifdef YYERRORSYMBOL
613   if( stateno>YY_REDUCE_COUNT ){
614     return yy_default[stateno];
615   }
616 #else
617   assert( stateno<=YY_REDUCE_COUNT );
618 #endif
619   i = yy_reduce_ofst[stateno];
620   assert( i!=YY_REDUCE_USE_DFLT );
621   assert( iLookAhead!=YYNOCODE );
622   i += iLookAhead;
623 #ifdef YYERRORSYMBOL
624   if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
625     return yy_default[stateno];
626   }
627 #else
628   assert( i>=0 && i<YY_ACTTAB_COUNT );
629   assert( yy_lookahead[i]==iLookAhead );
630 #endif
631   return yy_action[i];
632 }
633 
634 /*
635 ** The following routine is called if the stack overflows.
636 */
yyStackOverflow(yyParser * yypParser,YYMINORTYPE * yypMinor)637 static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){
638    priv_gda_sql_delimiterARG_FETCH;
639    yypParser->yyidx--;
640 #ifndef NDEBUG
641    if( yyTraceFILE ){
642      fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
643    }
644 #endif
645    while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
646    /* Here code is inserted which will execute if the parser
647    ** stack every overflows */
648 #line 25 "./delimiter.y"
649 
650 	gda_sql_parser_set_overflow_error (pdata->parser);
651 #line 652 "delimiter.c"
652    priv_gda_sql_delimiterARG_STORE; /* Suppress warning about unused %extra_argument var */
653 }
654 
655 /*
656 ** Perform a shift action.
657 */
yy_shift(yyParser * yypParser,int yyNewState,int yyMajor,YYMINORTYPE * yypMinor)658 static void yy_shift(
659   yyParser *yypParser,          /* The parser to be shifted */
660   int yyNewState,               /* The new state to shift in */
661   int yyMajor,                  /* The major token to shift in */
662   YYMINORTYPE *yypMinor         /* Pointer to the minor token to shift in */
663 ){
664   yyStackEntry *yytos;
665   yypParser->yyidx++;
666 #ifdef YYTRACKMAXSTACKDEPTH
667   if( yypParser->yyidx>yypParser->yyidxMax ){
668     yypParser->yyidxMax = yypParser->yyidx;
669   }
670 #endif
671 #if YYSTACKDEPTH>0
672   if( yypParser->yyidx>=YYSTACKDEPTH ){
673     yyStackOverflow(yypParser, yypMinor);
674     return;
675   }
676 #else
677   if( yypParser->yyidx>=yypParser->yystksz ){
678     yyGrowStack(yypParser);
679     if( yypParser->yyidx>=yypParser->yystksz ){
680       yyStackOverflow(yypParser, yypMinor);
681       return;
682     }
683   }
684 #endif
685   yytos = &yypParser->yystack[yypParser->yyidx];
686   yytos->stateno = (YYACTIONTYPE)yyNewState;
687   yytos->major = (YYCODETYPE)yyMajor;
688   yytos->minor = *yypMinor;
689 #ifndef NDEBUG
690   if( yyTraceFILE && yypParser->yyidx>0 ){
691     int i;
692     fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
693     fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
694     for(i=1; i<=yypParser->yyidx; i++)
695       fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]);
696     fprintf(yyTraceFILE,"\n");
697   }
698 #endif
699 }
700 
701 /* The following table contains information about every rule that
702 ** is used during the reduce.
703 */
704 static const struct {
705   YYCODETYPE lhs;         /* Symbol on the left-hand side of the rule */
706   unsigned char nrhs;     /* Number of right-hand side symbols in the rule */
707 } yyRuleInfo[] = {
708   { 25, 2 },
709   { 25, 2 },
710   { 26, 2 },
711   { 26, 1 },
712   { 27, 1 },
713   { 27, 1 },
714   { 27, 1 },
715   { 27, 1 },
716   { 29, 1 },
717   { 29, 1 },
718   { 29, 1 },
719   { 29, 1 },
720   { 28, 4 },
721   { 28, 4 },
722   { 28, 1 },
723   { 30, 0 },
724   { 30, 2 },
725   { 30, 2 },
726   { 30, 2 },
727   { 30, 2 },
728 };
729 
730 static void yy_accept(yyParser*);  /* Forward Declaration */
731 
732 /*
733 ** Perform a reduce action and the shift that must immediately
734 ** follow the reduce.
735 */
yy_reduce(yyParser * yypParser,int yyruleno)736 static void yy_reduce(
737   yyParser *yypParser,         /* The parser */
738   int yyruleno                 /* Number of the rule by which to reduce */
739 ){
740   int yygoto;                     /* The next state */
741   int yyact;                      /* The next action */
742   YYMINORTYPE yygotominor;        /* The LHS of the rule reduced */
743   yyStackEntry *yymsp;            /* The top of the parser's stack */
744   int yysize;                     /* Amount to pop the stack */
745   priv_gda_sql_delimiterARG_FETCH;
746   yymsp = &yypParser->yystack[yypParser->yyidx];
747 #ifndef NDEBUG
748   if( yyTraceFILE && yyruleno>=0
749         && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
750     fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
751       yyRuleName[yyruleno]);
752   }
753 #endif /* NDEBUG */
754 
755   /* Silence complaints from purify about yygotominor being uninitialized
756   ** in some cases when it is copied into the stack after the following
757   ** switch.  yygotominor is uninitialized when a rule reduces that does
758   ** not set the value of its left-hand side nonterminal.  Leaving the
759   ** value of the nonterminal uninitialized is utterly harmless as long
760   ** as the value is never used.  So really the only thing this code
761   ** accomplishes is to quieten purify.
762   **
763   ** 2007-01-16:  The wireshark project (www.wireshark.org) reports that
764   ** without this code, their parser segfaults.  I'm not sure what there
765   ** parser is doing to make this happen.  This is the second bug report
766   ** from wireshark this week.  Clearly they are stressing Lemon in ways
767   ** that it has not been previously stressed...  (SQLite ticket #2172)
768   */
769   /*memset(&yygotominor, 0, sizeof(yygotominor));*/
770   yygotominor = yyzerominor;
771 
772 
773   switch( yyruleno ){
774   /* Beginning here are the reduction cases.  A typical example
775   ** follows:
776   **   case 0:
777   **  #line <lineno> <grammarfile>
778   **     { ... }           // User supplied code
779   **  #line <lineno> <thisfile>
780   **     break;
781   */
782       case 0: /* stmt ::= exprlist SEMI */
783 #line 62 "./delimiter.y"
784 {pdata->parsed_statement = gda_sql_statement_new (GDA_SQL_STATEMENT_UNKNOWN);
785 			    /* FIXME: set SQL */
786 			    gda_sql_statement_unknown_take_expressions (pdata->parsed_statement, g_slist_reverse (yymsp[-1].minor.yy27));
787   yy_destructor(yypParser,9,&yymsp[0].minor);
788 }
789 #line 790 "delimiter.c"
790         break;
791       case 1: /* stmt ::= exprlist END_OF_FILE */
792 #line 66 "./delimiter.y"
793 {pdata->parsed_statement = gda_sql_statement_new (GDA_SQL_STATEMENT_UNKNOWN);
794 				   /* FIXME: set SQL */
795 				   gda_sql_statement_unknown_take_expressions (pdata->parsed_statement, g_slist_reverse (yymsp[-1].minor.yy27));
796   yy_destructor(yypParser,10,&yymsp[0].minor);
797 }
798 #line 799 "delimiter.c"
799         break;
800       case 2: /* exprlist ::= exprlist expr */
801 #line 74 "./delimiter.y"
802 {yygotominor.yy27 = g_slist_prepend (yymsp[-1].minor.yy27, yymsp[0].minor.yy54);}
803 #line 804 "delimiter.c"
804         break;
805       case 3: /* exprlist ::= expr */
806 #line 75 "./delimiter.y"
807 {yygotominor.yy27 = g_slist_append (NULL, yymsp[0].minor.yy54);}
808 #line 809 "delimiter.c"
809         break;
810       case 4: /* expr ::= pvalue */
811 #line 80 "./delimiter.y"
812 {yygotominor.yy54 = yymsp[0].minor.yy54;}
813 #line 814 "delimiter.c"
814         break;
815       case 5: /* expr ::= RAWSTRING */
816 #line 81 "./delimiter.y"
817 {yygotominor.yy54 = gda_sql_expr_new (NULL); yygotominor.yy54->value = yymsp[0].minor.yy0;}
818 #line 819 "delimiter.c"
819         break;
820       case 6: /* expr ::= SPACE */
821       case 7: /* expr ::= value */ yytestcase(yyruleno==7);
822 #line 82 "./delimiter.y"
823 {yygotominor.yy54 =gda_sql_expr_new (NULL); yygotominor.yy54->value = yymsp[0].minor.yy0;}
824 #line 825 "delimiter.c"
825         break;
826       case 8: /* value ::= STRING */
827       case 9: /* value ::= TEXTUAL */ yytestcase(yyruleno==9);
828       case 10: /* value ::= INTEGER */ yytestcase(yyruleno==10);
829       case 11: /* value ::= FLOAT */ yytestcase(yyruleno==11);
830 #line 86 "./delimiter.y"
831 {yygotominor.yy0 = yymsp[0].minor.yy0;}
832 #line 833 "delimiter.c"
833         break;
834       case 12: /* pvalue ::= UNSPECVAL LSBRACKET paramspec RSBRACKET */
835 #line 94 "./delimiter.y"
836 {yygotominor.yy54 = gda_sql_expr_new (NULL); yygotominor.yy54->param_spec = yymsp[-1].minor.yy3;  yy_destructor(yypParser,16,&yymsp[-3].minor);
837   yy_destructor(yypParser,17,&yymsp[-2].minor);
838   yy_destructor(yypParser,18,&yymsp[0].minor);
839 }
840 #line 841 "delimiter.c"
841         break;
842       case 13: /* pvalue ::= value LSBRACKET paramspec RSBRACKET */
843 #line 95 "./delimiter.y"
844 {yygotominor.yy54 = gda_sql_expr_new (NULL); yygotominor.yy54->value = yymsp[-3].minor.yy0; yygotominor.yy54->param_spec = yymsp[-1].minor.yy3;  yy_destructor(yypParser,17,&yymsp[-2].minor);
845   yy_destructor(yypParser,18,&yymsp[0].minor);
846 }
847 #line 848 "delimiter.c"
848         break;
849       case 14: /* pvalue ::= SIMPLEPARAM */
850 #line 96 "./delimiter.y"
851 {yygotominor.yy54 = gda_sql_expr_new (NULL); yygotominor.yy54->param_spec = gda_sql_param_spec_new (yymsp[0].minor.yy0);}
852 #line 853 "delimiter.c"
853         break;
854       case 15: /* paramspec ::= */
855 #line 101 "./delimiter.y"
856 {yygotominor.yy3 = NULL;}
857 #line 858 "delimiter.c"
858         break;
859       case 16: /* paramspec ::= paramspec PNAME */
860 #line 102 "./delimiter.y"
861 {if (!yymsp[-1].minor.yy3) yygotominor.yy3 = gda_sql_param_spec_new (NULL); else yygotominor.yy3 = yymsp[-1].minor.yy3;
862 					 gda_sql_param_spec_take_name (yygotominor.yy3, yymsp[0].minor.yy0);}
863 #line 864 "delimiter.c"
864         break;
865       case 17: /* paramspec ::= paramspec PDESCR */
866 #line 104 "./delimiter.y"
867 {if (!yymsp[-1].minor.yy3) yygotominor.yy3 = gda_sql_param_spec_new (NULL); else yygotominor.yy3 = yymsp[-1].minor.yy3;
868 					 gda_sql_param_spec_take_descr (yygotominor.yy3, yymsp[0].minor.yy0);}
869 #line 870 "delimiter.c"
870         break;
871       case 18: /* paramspec ::= paramspec PTYPE */
872 #line 106 "./delimiter.y"
873 {if (!yymsp[-1].minor.yy3) yygotominor.yy3 = gda_sql_param_spec_new (NULL); else yygotominor.yy3 = yymsp[-1].minor.yy3;
874 					 gda_sql_param_spec_take_type (yygotominor.yy3, yymsp[0].minor.yy0);}
875 #line 876 "delimiter.c"
876         break;
877       case 19: /* paramspec ::= paramspec PNULLOK */
878 #line 108 "./delimiter.y"
879 {if (!yymsp[-1].minor.yy3) yygotominor.yy3 = gda_sql_param_spec_new (NULL); else yygotominor.yy3 = yymsp[-1].minor.yy3;
880 					   gda_sql_param_spec_take_nullok (yygotominor.yy3, yymsp[0].minor.yy0);}
881 #line 882 "delimiter.c"
882         break;
883       default:
884         break;
885   };
886   yygoto = yyRuleInfo[yyruleno].lhs;
887   yysize = yyRuleInfo[yyruleno].nrhs;
888   yypParser->yyidx -= yysize;
889   yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto);
890   if( yyact < YYNSTATE ){
891 #ifdef NDEBUG
892     /* If we are not debugging and the reduce action popped at least
893     ** one element off the stack, then we can push the new element back
894     ** onto the stack here, and skip the stack overflow test in yy_shift().
895     ** That gives a significant speed improvement. */
896     if( yysize ){
897       yypParser->yyidx++;
898       yymsp -= yysize-1;
899       yymsp->stateno = (YYACTIONTYPE)yyact;
900       yymsp->major = (YYCODETYPE)yygoto;
901       yymsp->minor = yygotominor;
902     }else
903 #endif
904     {
905       yy_shift(yypParser,yyact,yygoto,&yygotominor);
906     }
907   }else{
908     assert( yyact == YYNSTATE + YYNRULE + 1 );
909     yy_accept(yypParser);
910   }
911 }
912 
913 /*
914 ** The following code executes when the parse fails
915 */
916 #ifndef YYNOERRORRECOVERY
yy_parse_failed(yyParser * yypParser)917 static void yy_parse_failed(
918   yyParser *yypParser           /* The parser */
919 ){
920   priv_gda_sql_delimiterARG_FETCH;
921 #ifndef NDEBUG
922   if( yyTraceFILE ){
923     fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
924   }
925 #endif
926   while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
927   /* Here code is inserted which will be executed whenever the
928   ** parser fails */
929   priv_gda_sql_delimiterARG_STORE; /* Suppress warning about unused %extra_argument variable */
930 }
931 #endif /* YYNOERRORRECOVERY */
932 
933 /*
934 ** The following code executes when a syntax error first occurs.
935 */
yy_syntax_error(yyParser * yypParser,int yymajor,YYMINORTYPE yyminor)936 static void yy_syntax_error(
937   yyParser *yypParser,           /* The parser */
938   int yymajor,                   /* The major type of the error token */
939   YYMINORTYPE yyminor            /* The minor type of the error token */
940 ){
941   priv_gda_sql_delimiterARG_FETCH;
942 #define TOKEN (yyminor.yy0)
943 #line 22 "./delimiter.y"
944 
945 	gda_sql_parser_set_syntax_error (pdata->parser);
946 #line 947 "delimiter.c"
947   priv_gda_sql_delimiterARG_STORE; /* Suppress warning about unused %extra_argument variable */
948 }
949 
950 /*
951 ** The following is executed when the parser accepts
952 */
yy_accept(yyParser * yypParser)953 static void yy_accept(
954   yyParser *yypParser           /* The parser */
955 ){
956   priv_gda_sql_delimiterARG_FETCH;
957 #ifndef NDEBUG
958   if( yyTraceFILE ){
959     fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
960   }
961 #endif
962   while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
963   /* Here code is inserted which will be executed whenever the
964   ** parser accepts */
965   priv_gda_sql_delimiterARG_STORE; /* Suppress warning about unused %extra_argument variable */
966 }
967 
968 /* The main parser program.
969 ** The first argument is a pointer to a structure obtained from
970 ** "priv_gda_sql_delimiterAlloc" which describes the current state of the parser.
971 ** The second argument is the major token number.  The third is
972 ** the minor token.  The fourth optional argument is whatever the
973 ** user wants (and specified in the grammar) and is available for
974 ** use by the action routines.
975 **
976 ** Inputs:
977 ** <ul>
978 ** <li> A pointer to the parser (an opaque structure.)
979 ** <li> The major token number.
980 ** <li> The minor token number.
981 ** <li> An option argument of a grammar-specified type.
982 ** </ul>
983 **
984 ** Outputs:
985 ** None.
986 */
priv_gda_sql_delimiter(void * yyp,int yymajor,priv_gda_sql_delimiterTOKENTYPE yyminor priv_gda_sql_delimiterARG_PDECL)987 void priv_gda_sql_delimiter(
988   void *yyp,                   /* The parser */
989   int yymajor,                 /* The major token code number */
990   priv_gda_sql_delimiterTOKENTYPE yyminor       /* The value for the token */
991   priv_gda_sql_delimiterARG_PDECL               /* Optional %extra_argument parameter */
992 ){
993   YYMINORTYPE yyminorunion;
994   int yyact;            /* The parser action. */
995   int yyendofinput;     /* True if we are at the end of input */
996 #ifdef YYERRORSYMBOL
997   int yyerrorhit = 0;   /* True if yymajor has invoked an error */
998 #endif
999   yyParser *yypParser;  /* The parser */
1000 
1001   /* (re)initialize the parser, if necessary */
1002   yypParser = (yyParser*)yyp;
1003   if( yypParser->yyidx<0 ){
1004 #if YYSTACKDEPTH<=0
1005     if( yypParser->yystksz <=0 ){
1006       /*memset(&yyminorunion, 0, sizeof(yyminorunion));*/
1007       yyminorunion = yyzerominor;
1008       yyStackOverflow(yypParser, &yyminorunion);
1009       return;
1010     }
1011 #endif
1012     yypParser->yyidx = 0;
1013     yypParser->yyerrcnt = -1;
1014     yypParser->yystack[0].stateno = 0;
1015     yypParser->yystack[0].major = 0;
1016   }
1017   yyminorunion.yy0 = yyminor;
1018   yyendofinput = (yymajor==0);
1019   priv_gda_sql_delimiterARG_STORE;
1020 
1021 #ifndef NDEBUG
1022   if( yyTraceFILE ){
1023     fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
1024   }
1025 #endif
1026 
1027   do{
1028     yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor);
1029     if( yyact<YYNSTATE ){
1030       assert( !yyendofinput );  /* Impossible to shift the $ token */
1031       yy_shift(yypParser,yyact,yymajor,&yyminorunion);
1032       yypParser->yyerrcnt--;
1033       yymajor = YYNOCODE;
1034     }else if( yyact < YYNSTATE + YYNRULE ){
1035       yy_reduce(yypParser,yyact-YYNSTATE);
1036     }else{
1037       assert( yyact == YY_ERROR_ACTION );
1038 #ifdef YYERRORSYMBOL
1039       int yymx;
1040 #endif
1041 #ifndef NDEBUG
1042       if( yyTraceFILE ){
1043         fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
1044       }
1045 #endif
1046 #ifdef YYERRORSYMBOL
1047       /* A syntax error has occurred.
1048       ** The response to an error depends upon whether or not the
1049       ** grammar defines an error token "ERROR".
1050       **
1051       ** This is what we do if the grammar does define ERROR:
1052       **
1053       **  * Call the %syntax_error function.
1054       **
1055       **  * Begin popping the stack until we enter a state where
1056       **    it is legal to shift the error symbol, then shift
1057       **    the error symbol.
1058       **
1059       **  * Set the error count to three.
1060       **
1061       **  * Begin accepting and shifting new tokens.  No new error
1062       **    processing will occur until three tokens have been
1063       **    shifted successfully.
1064       **
1065       */
1066       if( yypParser->yyerrcnt<0 ){
1067         yy_syntax_error(yypParser,yymajor,yyminorunion);
1068       }
1069       yymx = yypParser->yystack[yypParser->yyidx].major;
1070       if( yymx==YYERRORSYMBOL || yyerrorhit ){
1071 #ifndef NDEBUG
1072         if( yyTraceFILE ){
1073           fprintf(yyTraceFILE,"%sDiscard input token %s\n",
1074              yyTracePrompt,yyTokenName[yymajor]);
1075         }
1076 #endif
1077         yy_destructor(yypParser, (YYCODETYPE)yymajor,&yyminorunion);
1078         yymajor = YYNOCODE;
1079       }else{
1080          while(
1081           yypParser->yyidx >= 0 &&
1082           yymx != YYERRORSYMBOL &&
1083           (yyact = yy_find_reduce_action(
1084                         yypParser->yystack[yypParser->yyidx].stateno,
1085                         YYERRORSYMBOL)) >= YYNSTATE
1086         ){
1087           yy_pop_parser_stack(yypParser);
1088         }
1089         if( yypParser->yyidx < 0 || yymajor==0 ){
1090           yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
1091           yy_parse_failed(yypParser);
1092           yymajor = YYNOCODE;
1093         }else if( yymx!=YYERRORSYMBOL ){
1094           YYMINORTYPE u2;
1095           u2.YYERRSYMDT = 0;
1096           yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
1097         }
1098       }
1099       yypParser->yyerrcnt = 3;
1100       yyerrorhit = 1;
1101 #elif defined(YYNOERRORRECOVERY)
1102       /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
1103       ** do any kind of error recovery.  Instead, simply invoke the syntax
1104       ** error routine and continue going as if nothing had happened.
1105       **
1106       ** Applications can set this macro (for example inside %include) if
1107       ** they intend to abandon the parse upon the first syntax error seen.
1108       */
1109       yy_syntax_error(yypParser,yymajor,yyminorunion);
1110       yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
1111       yymajor = YYNOCODE;
1112 
1113 #else  /* YYERRORSYMBOL is not defined */
1114       /* This is what we do if the grammar does not define ERROR:
1115       **
1116       **  * Report an error message, and throw away the input token.
1117       **
1118       **  * If the input token is $, then fail the parse.
1119       **
1120       ** As before, subsequent error messages are suppressed until
1121       ** three input tokens have been successfully shifted.
1122       */
1123       if( yypParser->yyerrcnt<=0 ){
1124         yy_syntax_error(yypParser,yymajor,yyminorunion);
1125       }
1126       yypParser->yyerrcnt = 3;
1127       yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
1128       if( yyendofinput ){
1129         yy_parse_failed(yypParser);
1130       }
1131       yymajor = YYNOCODE;
1132 #endif
1133     }
1134   }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
1135   return;
1136 }
1137