Added quantiling UDAFs
[com/gs-lite.git] / src / ftacmp / schema.tab.cc
1 \r
2 /*  A Bison parser, made from schema.y\r
3  by  GNU Bison version 1.25\r
4   */\r
5 \r
6 #define YYBISON 1  /* Identify Bison output.  */\r
7 \r
8 #define yyparse SchemaParserparse\r
9 #define yylex SchemaParserlex\r
10 #define yyerror SchemaParsererror\r
11 #define yylval SchemaParserlval\r
12 #define yychar SchemaParserchar\r
13 #define yydebug SchemaParserdebug\r
14 #define yynerrs SchemaParsernerrs\r
15 #define NAME    258\r
16 #define SEMICOLON       259\r
17 #define LEFTBRACE       260\r
18 #define RIGHTBRACE      261\r
19 #define TABLE   262\r
20 #define STREAM  263\r
21 \r
22 #line 8 "schema.y"\r
23 \r
24 \r
25 \r
26 #include <stdio.h>\r
27 \r
28 /*              Some addn'l includes, necessary but not included by the\r
29                 bison generated code.\r
30 */\r
31 \r
32 #include <stdlib.h>\r
33 \r
34 /*              prototypes for the parser callbacks.\r
35 */\r
36 \r
37 #include "parse_schema.h"\r
38 \r
39 /*              Interface to schemalexer        */\r
40         int yyparse();\r
41         void yyerror(char *s);\r
42         int yylex();\r
43 extern int flex_schema_lineno, flex_schema_ch;\r
44 \r
45 /*              Return value    */\r
46 extern table_list *Schema;\r
47 \r
48 #define YYDEBUG 1\r
49 \r
50 \r
51 #line 40 "schema.y"\r
52 typedef union {\r
53         char* strval;\r
54         field_entry *field_t;\r
55         field_entry_list *field_list_t;\r
56         table_def *table_def_t;\r
57         table_list *table_list_t;\r
58         param_list *plist_t;\r
59         } YYSTYPE;\r
60 #include <stdio.h>\r
61 \r
62 #ifndef __cplusplus\r
63 #ifndef __STDC__\r
64 #define const\r
65 #endif\r
66 #endif\r
67 \r
68 \r
69 \r
70 #define YYFINAL         31\r
71 #define YYFLAG          -32768\r
72 #define YYNTBASE        12\r
73 \r
74 #define YYTRANSLATE(x) ((unsigned)(x) <= 263 ? yytranslate[x] : 19)\r
75 \r
76 static const char yytranslate[] = {     0,\r
77      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
78      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
79      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
80      2,     2,     2,     2,     2,     2,     2,     2,     2,     9,\r
81     10,     2,     2,    11,     2,     2,     2,     2,     2,     2,\r
82      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
83      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
84      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
85      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
86      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
87      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
88      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
89      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
90      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
91      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
92      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
93      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
94      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
95      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
96      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
97      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
98      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
99      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
100      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
101      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,\r
102      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,\r
103      6,     7,     8\r
104 };\r
105 \r
106 #if YYDEBUG != 0\r
107 static const short yyprhs[] = {     0,\r
108      0,     2,     4,     7,    14,    21,    23,    26,    32,    33,\r
109     37,    39\r
110 };\r
111 \r
112 static const short yyrhs[] = {    13,\r
113      0,    14,     0,    13,    14,     0,     7,     3,    17,     5,\r
114     15,     6,     0,     8,     3,    17,     5,    15,     6,     0,\r
115     16,     0,    15,    16,     0,     3,     3,     3,    17,     4,\r
116      0,     0,     9,    18,    10,     0,     3,     0,    18,    11,\r
117      3,     0\r
118 };\r
119 \r
120 #endif\r
121 \r
122 #if YYDEBUG != 0\r
123 static const short yyrline[] = { 0,\r
124     68,    70,    71,    74,    76,    80,    81,    84,    88,    90,\r
125     93,    95\r
126 };\r
127 #endif\r
128 \r
129 \r
130 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)\r
131 \r
132 static const char * const yytname[] = {   "$","error","$undefined.","NAME","SEMICOLON",\r
133 "LEFTBRACE","RIGHTBRACE","TABLE","STREAM","'('","')'","','","result","table_list",\r
134 "table_def","field_list","field","opt_param_commalist","param_commalist", NULL\r
135 };\r
136 #endif\r
137 \r
138 static const short yyr1[] = {     0,\r
139     12,    13,    13,    14,    14,    15,    15,    16,    17,    17,\r
140     18,    18\r
141 };\r
142 \r
143 static const short yyr2[] = {     0,\r
144      1,     1,     2,     6,     6,     1,     2,     5,     0,     3,\r
145      1,     3\r
146 };\r
147 \r
148 static const short yydefact[] = {     0,\r
149      0,     0,     1,     2,     9,     9,     3,     0,     0,     0,\r
150     11,     0,     0,     0,    10,     0,     0,     0,     6,     0,\r
151     12,     0,     4,     7,     5,     9,     0,     8,     0,     0,\r
152      0\r
153 };\r
154 \r
155 static const short yydefgoto[] = {    29,\r
156      3,     4,    18,    19,     9,    12\r
157 };\r
158 \r
159 static const short yypact[] = {     2,\r
160      0,     4,     2,-32768,     5,     5,-32768,    10,    11,    12,\r
161 -32768,     1,    15,    15,-32768,    16,    18,    -2,-32768,    -1,\r
162 -32768,    19,-32768,-32768,-32768,     5,    20,-32768,    23,    25,\r
163 -32768\r
164 };\r
165 \r
166 static const short yypgoto[] = {-32768,\r
167 -32768,    24,    14,   -12,    -6,-32768\r
168 };\r
169 \r
170 \r
171 #define YYLAST          28\r
172 \r
173 \r
174 static const short yytable[] = {    10,\r
175     17,    17,     5,    23,    25,    24,     6,    24,     1,     2,\r
176     15,    16,    11,     8,     0,    13,    14,    17,    21,    27,\r
177     22,    26,    30,    28,    31,     0,     7,    20\r
178 };\r
179 \r
180 static const short yycheck[] = {     6,\r
181      3,     3,     3,     6,     6,    18,     3,    20,     7,     8,\r
182     10,    11,     3,     9,    -1,     5,     5,     3,     3,    26,\r
183      3,     3,     0,     4,     0,    -1,     3,    14\r
184 };\r
185 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */\r
186 #line 3 "bison.simple"\r
187 \r
188 /* Skeleton output parser for bison,\r
189    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.\r
190 \r
191    This program is free software; you can redistribute it and/or modify\r
192    it under the terms of the GNU General Public License as published by\r
193    the Free Software Foundation; either version 2, or (at your option)\r
194    any later version.\r
195 \r
196    This program is distributed in the hope that it will be useful,\r
197    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
198    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
199    GNU General Public License for more details.\r
200 \r
201    You should have received a copy of the GNU General Public License\r
202    along with this program; if not, write to the Free Software\r
203    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */\r
204 \r
205 /* As a special exception, when this file is copied by Bison into a\r
206    Bison output file, you may use that output file without restriction.\r
207    This special exception was added by the Free Software Foundation\r
208    in version 1.24 of Bison.  */\r
209 \r
210 #ifndef alloca\r
211 #ifdef __GNUC__\r
212 #define alloca __builtin_alloca\r
213 #else /* not GNU C.  */\r
214 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)\r
215 #include <alloca.h>\r
216 #else /* not sparc */\r
217 #if defined (MSDOS) && !defined (__TURBOC__)\r
218 #include <malloc.h>\r
219 #else /* not MSDOS, or __TURBOC__ */\r
220 #if defined(_AIX)\r
221 #include <malloc.h>\r
222  #pragma alloca\r
223 #else /* not MSDOS, __TURBOC__, or _AIX */\r
224 #ifdef __hpux\r
225 #ifdef __cplusplus\r
226 extern "C" {\r
227 void *alloca (unsigned int);\r
228 };\r
229 #else /* not __cplusplus */\r
230 void *alloca ();\r
231 #endif /* not __cplusplus */\r
232 #endif /* __hpux */\r
233 #endif /* not _AIX */\r
234 #endif /* not MSDOS, or __TURBOC__ */\r
235 #endif /* not sparc.  */\r
236 #endif /* not GNU C.  */\r
237 #endif /* alloca not defined.  */\r
238 \r
239 /* This is the parser code that is written into each bison parser\r
240   when the %semantic_parser declaration is not specified in the grammar.\r
241   It was written by Richard Stallman by simplifying the hairy parser\r
242   used when %semantic_parser is specified.  */\r
243 \r
244 /* Note: there must be only one dollar sign in this file.\r
245    It is replaced by the list of actions, each action\r
246    as one case of the switch.  */\r
247 \r
248 #define yyerrok         (yyerrstatus = 0)\r
249 #define yyclearin       (yychar = YYEMPTY)\r
250 #define YYEMPTY         -2\r
251 #define YYEOF           0\r
252 #define YYACCEPT        return(0)\r
253 #define YYABORT         return(1)\r
254 #define YYERROR         goto yyerrlab1\r
255 /* Like YYERROR except do call yyerror.\r
256    This remains here temporarily to ease the\r
257    transition to the new meaning of YYERROR, for GCC.\r
258    Once GCC version 2 has supplanted version 1, this can go.  */\r
259 #define YYFAIL          goto yyerrlab\r
260 #define YYRECOVERING()  (!!yyerrstatus)\r
261 #define YYBACKUP(token, value) \\r
262 do                                                              \\r
263   if (yychar == YYEMPTY && yylen == 1)                          \\r
264     { yychar = (token), yylval = (value);                       \\r
265       yychar1 = YYTRANSLATE (yychar);                           \\r
266       YYPOPSTACK;                                               \\r
267       goto yybackup;                                            \\r
268     }                                                           \\r
269   else                                                          \\r
270     { yyerror ("syntax error: cannot back up"); YYERROR; }      \\r
271 while (0)\r
272 \r
273 #define YYTERROR        1\r
274 #define YYERRCODE       256\r
275 \r
276 #ifndef YYPURE\r
277 #define YYLEX           yylex()\r
278 #endif\r
279 \r
280 #ifdef YYPURE\r
281 #ifdef YYLSP_NEEDED\r
282 #ifdef YYLEX_PARAM\r
283 #define YYLEX           yylex(&yylval, &yylloc, YYLEX_PARAM)\r
284 #else\r
285 #define YYLEX           yylex(&yylval, &yylloc)\r
286 #endif\r
287 #else /* not YYLSP_NEEDED */\r
288 #ifdef YYLEX_PARAM\r
289 #define YYLEX           yylex(&yylval, YYLEX_PARAM)\r
290 #else\r
291 #define YYLEX           yylex(&yylval)\r
292 #endif\r
293 #endif /* not YYLSP_NEEDED */\r
294 #endif\r
295 \r
296 /* If nonreentrant, generate the variables here */\r
297 \r
298 #ifndef YYPURE\r
299 \r
300 int     yychar;                 /*  the lookahead symbol                */\r
301 YYSTYPE yylval;                 /*  the semantic value of the           */\r
302                                 /*  lookahead symbol                    */\r
303 \r
304 #ifdef YYLSP_NEEDED\r
305 YYLTYPE yylloc;                 /*  location data for the lookahead     */\r
306                                 /*  symbol                              */\r
307 #endif\r
308 \r
309 int yynerrs;                    /*  number of parse errors so far       */\r
310 #endif  /* not YYPURE */\r
311 \r
312 #if YYDEBUG != 0\r
313 int yydebug;                    /*  nonzero means print parse trace     */\r
314 /* Since this is uninitialized, it does not stop multiple parsers\r
315    from coexisting.  */\r
316 #endif\r
317 \r
318 /*  YYINITDEPTH indicates the initial size of the parser's stacks       */\r
319 \r
320 #ifndef YYINITDEPTH\r
321 #define YYINITDEPTH 200\r
322 #endif\r
323 \r
324 /*  YYMAXDEPTH is the maximum size the stacks can grow to\r
325     (effective only if the built-in stack extension method is used).  */\r
326 \r
327 #if YYMAXDEPTH == 0\r
328 #undef YYMAXDEPTH\r
329 #endif\r
330 \r
331 #ifndef YYMAXDEPTH\r
332 #define YYMAXDEPTH 10000\r
333 #endif\r
334 \r
335 /* Prevent warning if -Wstrict-prototypes.  */\r
336 #ifdef __GNUC__\r
337 int yyparse (void);\r
338 #endif\r
339 \f\r
340 #if __GNUC__ > 1                /* GNU C and GNU C++ define this.  */\r
341 #define __yy_memcpy(TO,FROM,COUNT)      __builtin_memcpy(TO,FROM,COUNT)\r
342 #else                           /* not GNU C or C++ */\r
343 #ifndef __cplusplus\r
344 \r
345 /* This is the most reliable way to avoid incompatibilities\r
346    in available built-in functions on various systems.  */\r
347 static void\r
348 __yy_memcpy (to, from, count)\r
349      char *to;\r
350      char *from;\r
351      int count;\r
352 {\r
353   register char *f = from;\r
354   register char *t = to;\r
355   register int i = count;\r
356 \r
357   while (i-- > 0)\r
358     *t++ = *f++;\r
359 }\r
360 \r
361 #else /* __cplusplus */\r
362 \r
363 /* This is the most reliable way to avoid incompatibilities\r
364    in available built-in functions on various systems.  */\r
365 static void\r
366 __yy_memcpy (char *to, char *from, int count)\r
367 {\r
368   register char *f = from;\r
369   register char *t = to;\r
370   register int i = count;\r
371 \r
372   while (i-- > 0)\r
373     *t++ = *f++;\r
374 }\r
375 \r
376 #endif\r
377 #endif\r
378 \f\r
379 #line 196 "bison.simple"\r
380 \r
381 /* The user can define YYPARSE_PARAM as the name of an argument to be passed\r
382    into yyparse.  The argument should have type void *.\r
383    It should actually point to an object.\r
384    Grammar actions can access the variable by casting it\r
385    to the proper pointer type.  */\r
386 \r
387 #ifdef YYPARSE_PARAM\r
388 #ifdef __cplusplus\r
389 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM\r
390 #define YYPARSE_PARAM_DECL\r
391 #else /* not __cplusplus */\r
392 #define YYPARSE_PARAM_ARG YYPARSE_PARAM\r
393 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;\r
394 #endif /* not __cplusplus */\r
395 #else /* not YYPARSE_PARAM */\r
396 #define YYPARSE_PARAM_ARG\r
397 #define YYPARSE_PARAM_DECL\r
398 #endif /* not YYPARSE_PARAM */\r
399 \r
400 int\r
401 yyparse(YYPARSE_PARAM_ARG)\r
402      YYPARSE_PARAM_DECL\r
403 {\r
404   register int yystate;\r
405   register int yyn;\r
406   register short *yyssp;\r
407   register YYSTYPE *yyvsp;\r
408   int yyerrstatus;      /*  number of tokens to shift before error messages enabled */\r
409   int yychar1 = 0;              /*  lookahead token as an internal (translated) token number */\r
410 \r
411   short yyssa[YYINITDEPTH];     /*  the state stack                     */\r
412   YYSTYPE yyvsa[YYINITDEPTH];   /*  the semantic value stack            */\r
413 \r
414   short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */\r
415   YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */\r
416 \r
417 #ifdef YYLSP_NEEDED\r
418   YYLTYPE yylsa[YYINITDEPTH];   /*  the location stack                  */\r
419   YYLTYPE *yyls = yylsa;\r
420   YYLTYPE *yylsp;\r
421 \r
422 #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)\r
423 #else\r
424 #define YYPOPSTACK   (yyvsp--, yyssp--)\r
425 #endif\r
426 \r
427   int yystacksize = YYINITDEPTH;\r
428 \r
429 #ifdef YYPURE\r
430   int yychar;\r
431   YYSTYPE yylval;\r
432   int yynerrs;\r
433 #ifdef YYLSP_NEEDED\r
434   YYLTYPE yylloc;\r
435 #endif\r
436 #endif\r
437 \r
438   YYSTYPE yyval;                /*  the variable used to return         */\r
439                                 /*  semantic values from the action     */\r
440                                 /*  routines                            */\r
441 \r
442   int yylen;\r
443 \r
444 #if YYDEBUG != 0\r
445   if (yydebug)\r
446     fprintf(stderr, "Starting parse\n");\r
447 #endif\r
448 \r
449   yystate = 0;\r
450   yyerrstatus = 0;\r
451   yynerrs = 0;\r
452   yychar = YYEMPTY;             /* Cause a token to be read.  */\r
453 \r
454   /* Initialize stack pointers.\r
455      Waste one element of value and location stack\r
456      so that they stay on the same level as the state stack.\r
457      The wasted elements are never initialized.  */\r
458 \r
459   yyssp = yyss - 1;\r
460   yyvsp = yyvs;\r
461 #ifdef YYLSP_NEEDED\r
462   yylsp = yyls;\r
463 #endif\r
464 \r
465 /* Push a new state, which is found in  yystate  .  */\r
466 /* In all cases, when you get here, the value and location stacks\r
467    have just been pushed. so pushing a state here evens the stacks.  */\r
468 yynewstate:\r
469 \r
470   *++yyssp = yystate;\r
471 \r
472   if (yyssp >= yyss + yystacksize - 1)\r
473     {\r
474       /* Give user a chance to reallocate the stack */\r
475       /* Use copies of these so that the &'s don't force the real ones into memory. */\r
476       YYSTYPE *yyvs1 = yyvs;\r
477       short *yyss1 = yyss;\r
478 #ifdef YYLSP_NEEDED\r
479       YYLTYPE *yyls1 = yyls;\r
480 #endif\r
481 \r
482       /* Get the current used size of the three stacks, in elements.  */\r
483       int size = yyssp - yyss + 1;\r
484 \r
485 #ifdef yyoverflow\r
486       /* Each stack pointer address is followed by the size of\r
487          the data in use in that stack, in bytes.  */\r
488 #ifdef YYLSP_NEEDED\r
489       /* This used to be a conditional around just the two extra args,\r
490          but that might be undefined if yyoverflow is a macro.  */\r
491       yyoverflow("parser stack overflow",\r
492                  &yyss1, size * sizeof (*yyssp),\r
493                  &yyvs1, size * sizeof (*yyvsp),\r
494                  &yyls1, size * sizeof (*yylsp),\r
495                  &yystacksize);\r
496 #else\r
497       yyoverflow("parser stack overflow",\r
498                  &yyss1, size * sizeof (*yyssp),\r
499                  &yyvs1, size * sizeof (*yyvsp),\r
500                  &yystacksize);\r
501 #endif\r
502 \r
503       yyss = yyss1; yyvs = yyvs1;\r
504 #ifdef YYLSP_NEEDED\r
505       yyls = yyls1;\r
506 #endif\r
507 #else /* no yyoverflow */\r
508       /* Extend the stack our own way.  */\r
509       if (yystacksize >= YYMAXDEPTH)\r
510         {\r
511           yyerror("parser stack overflow");\r
512           return 2;\r
513         }\r
514       yystacksize *= 2;\r
515       if (yystacksize > YYMAXDEPTH)\r
516         yystacksize = YYMAXDEPTH;\r
517       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));\r
518       __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));\r
519       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));\r
520       __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));\r
521 #ifdef YYLSP_NEEDED\r
522       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));\r
523       __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));\r
524 #endif\r
525 #endif /* no yyoverflow */\r
526 \r
527       yyssp = yyss + size - 1;\r
528       yyvsp = yyvs + size - 1;\r
529 #ifdef YYLSP_NEEDED\r
530       yylsp = yyls + size - 1;\r
531 #endif\r
532 \r
533 #if YYDEBUG != 0\r
534       if (yydebug)\r
535         fprintf(stderr, "Stack size increased to %d\n", yystacksize);\r
536 #endif\r
537 \r
538       if (yyssp >= yyss + yystacksize - 1)\r
539         YYABORT;\r
540     }\r
541 \r
542 #if YYDEBUG != 0\r
543   if (yydebug)\r
544     fprintf(stderr, "Entering state %d\n", yystate);\r
545 #endif\r
546 \r
547   goto yybackup;\r
548  yybackup:\r
549 \r
550 /* Do appropriate processing given the current state.  */\r
551 /* Read a lookahead token if we need one and don't already have one.  */\r
552 /* yyresume: */\r
553 \r
554   /* First try to decide what to do without reference to lookahead token.  */\r
555 \r
556   yyn = yypact[yystate];\r
557   if (yyn == YYFLAG)\r
558     goto yydefault;\r
559 \r
560   /* Not known => get a lookahead token if don't already have one.  */\r
561 \r
562   /* yychar is either YYEMPTY or YYEOF\r
563      or a valid token in external form.  */\r
564 \r
565   if (yychar == YYEMPTY)\r
566     {\r
567 #if YYDEBUG != 0\r
568       if (yydebug)\r
569         fprintf(stderr, "Reading a token: ");\r
570 #endif\r
571       yychar = YYLEX;\r
572     }\r
573 \r
574   /* Convert token to internal form (in yychar1) for indexing tables with */\r
575 \r
576   if (yychar <= 0)              /* This means end of input. */\r
577     {\r
578       yychar1 = 0;\r
579       yychar = YYEOF;           /* Don't call YYLEX any more */\r
580 \r
581 #if YYDEBUG != 0\r
582       if (yydebug)\r
583         fprintf(stderr, "Now at end of input.\n");\r
584 #endif\r
585     }\r
586   else\r
587     {\r
588       yychar1 = YYTRANSLATE(yychar);\r
589 \r
590 #if YYDEBUG != 0\r
591       if (yydebug)\r
592         {\r
593           fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);\r
594           /* Give the individual parser a way to print the precise meaning\r
595              of a token, for further debugging info.  */\r
596 #ifdef YYPRINT\r
597           YYPRINT (stderr, yychar, yylval);\r
598 #endif\r
599           fprintf (stderr, ")\n");\r
600         }\r
601 #endif\r
602     }\r
603 \r
604   yyn += yychar1;\r
605   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)\r
606     goto yydefault;\r
607 \r
608   yyn = yytable[yyn];\r
609 \r
610   /* yyn is what to do for this token type in this state.\r
611      Negative => reduce, -yyn is rule number.\r
612      Positive => shift, yyn is new state.\r
613        New state is final state => don't bother to shift,\r
614        just return success.\r
615      0, or most negative number => error.  */\r
616 \r
617   if (yyn < 0)\r
618     {\r
619       if (yyn == YYFLAG)\r
620         goto yyerrlab;\r
621       yyn = -yyn;\r
622       goto yyreduce;\r
623     }\r
624   else if (yyn == 0)\r
625     goto yyerrlab;\r
626 \r
627   if (yyn == YYFINAL)\r
628     YYACCEPT;\r
629 \r
630   /* Shift the lookahead token.  */\r
631 \r
632 #if YYDEBUG != 0\r
633   if (yydebug)\r
634     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);\r
635 #endif\r
636 \r
637   /* Discard the token being shifted unless it is eof.  */\r
638   if (yychar != YYEOF)\r
639     yychar = YYEMPTY;\r
640 \r
641   *++yyvsp = yylval;\r
642 #ifdef YYLSP_NEEDED\r
643   *++yylsp = yylloc;\r
644 #endif\r
645 \r
646   /* count tokens shifted since error; after three, turn off error status.  */\r
647   if (yyerrstatus) yyerrstatus--;\r
648 \r
649   yystate = yyn;\r
650   goto yynewstate;\r
651 \r
652 /* Do the default action for the current state.  */\r
653 yydefault:\r
654 \r
655   yyn = yydefact[yystate];\r
656   if (yyn == 0)\r
657     goto yyerrlab;\r
658 \r
659 /* Do a reduction.  yyn is the number of a rule to reduce with.  */\r
660 yyreduce:\r
661   yylen = yyr2[yyn];\r
662   if (yylen > 0)\r
663     yyval = yyvsp[1-yylen]; /* implement default value of the action */\r
664 \r
665 #if YYDEBUG != 0\r
666   if (yydebug)\r
667     {\r
668       int i;\r
669 \r
670       fprintf (stderr, "Reducing via rule %d (line %d), ",\r
671                yyn, yyrline[yyn]);\r
672 \r
673       /* Print the symbols being reduced, and their result.  */\r
674       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)\r
675         fprintf (stderr, "%s ", yytname[yyrhs[i]]);\r
676       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);\r
677     }\r
678 #endif\r
679 \r
680 \r
681   switch (yyn) {\r
682 \r
683 case 1:\r
684 #line 68 "schema.y"\r
685 {Schema = yyvsp[0].table_list_t;;\r
686     break;}\r
687 case 2:\r
688 #line 70 "schema.y"\r
689 {yyval.table_list_t = new table_list(yyvsp[0].table_def_t);;\r
690     break;}\r
691 case 3:\r
692 #line 71 "schema.y"\r
693 {yyval.table_list_t = yyvsp[-1].table_list_t->append_table(yyvsp[0].table_def_t);;\r
694     break;}\r
695 case 4:\r
696 #line 74 "schema.y"\r
697 {\r
698                                         yyval.table_def_t=new table_def(yyvsp[-4].strval,yyvsp[-3].plist_t,yyvsp[-1].field_list_t, TABLE_SCHEMA); delete yyvsp[-1].field_list_t;;\r
699     break;}\r
700 case 5:\r
701 #line 76 "schema.y"\r
702 {\r
703                                         yyval.table_def_t=new table_def(yyvsp[-4].strval,yyvsp[-3].plist_t,yyvsp[-1].field_list_t, STREAM_SCHEMA); delete yyvsp[-1].field_list_t;;\r
704     break;}\r
705 case 6:\r
706 #line 80 "schema.y"\r
707 {yyval.field_list_t = new field_entry_list(yyvsp[0].field_t);;\r
708     break;}\r
709 case 7:\r
710 #line 81 "schema.y"\r
711 {yyval.field_list_t = yyvsp[-1].field_list_t->append_field(yyvsp[0].field_t);;\r
712     break;}\r
713 case 8:\r
714 #line 85 "schema.y"\r
715 {yyval.field_t = new field_entry(yyvsp[-4].strval,yyvsp[-3].strval,yyvsp[-2].strval,yyvsp[-1].plist_t);;\r
716     break;}\r
717 case 9:\r
718 #line 89 "schema.y"\r
719 {yyval.plist_t = NULL;;\r
720     break;}\r
721 case 10:\r
722 #line 90 "schema.y"\r
723 {yyval.plist_t = yyvsp[-1].plist_t;;\r
724     break;}\r
725 case 11:\r
726 #line 94 "schema.y"\r
727 {yyval.plist_t = new param_list(yyvsp[0].strval);;\r
728     break;}\r
729 case 12:\r
730 #line 95 "schema.y"\r
731 {yyval.plist_t = yyvsp[-2].plist_t->append(yyvsp[0].strval);;\r
732     break;}\r
733 }\r
734    /* the action file gets copied in in place of this dollarsign */\r
735 #line 498 "bison.simple"\r
736 \f\r
737   yyvsp -= yylen;\r
738   yyssp -= yylen;\r
739 #ifdef YYLSP_NEEDED\r
740   yylsp -= yylen;\r
741 #endif\r
742 \r
743 #if YYDEBUG != 0\r
744   if (yydebug)\r
745     {\r
746       short *ssp1 = yyss - 1;\r
747       fprintf (stderr, "state stack now");\r
748       while (ssp1 != yyssp)\r
749         fprintf (stderr, " %d", *++ssp1);\r
750       fprintf (stderr, "\n");\r
751     }\r
752 #endif\r
753 \r
754   *++yyvsp = yyval;\r
755 \r
756 #ifdef YYLSP_NEEDED\r
757   yylsp++;\r
758   if (yylen == 0)\r
759     {\r
760       yylsp->first_line = yylloc.first_line;\r
761       yylsp->first_column = yylloc.first_column;\r
762       yylsp->last_line = (yylsp-1)->last_line;\r
763       yylsp->last_column = (yylsp-1)->last_column;\r
764       yylsp->text = 0;\r
765     }\r
766   else\r
767     {\r
768       yylsp->last_line = (yylsp+yylen-1)->last_line;\r
769       yylsp->last_column = (yylsp+yylen-1)->last_column;\r
770     }\r
771 #endif\r
772 \r
773   /* Now "shift" the result of the reduction.\r
774      Determine what state that goes to,\r
775      based on the state we popped back to\r
776      and the rule number reduced by.  */\r
777 \r
778   yyn = yyr1[yyn];\r
779 \r
780   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;\r
781   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)\r
782     yystate = yytable[yystate];\r
783   else\r
784     yystate = yydefgoto[yyn - YYNTBASE];\r
785 \r
786   goto yynewstate;\r
787 \r
788 yyerrlab:   /* here on detecting error */\r
789 \r
790   if (! yyerrstatus)\r
791     /* If not already recovering from an error, report this error.  */\r
792     {\r
793       ++yynerrs;\r
794 \r
795 #ifdef YYERROR_VERBOSE\r
796       yyn = yypact[yystate];\r
797 \r
798       if (yyn > YYFLAG && yyn < YYLAST)\r
799         {\r
800           int size = 0;\r
801           char *msg;\r
802           int x, count;\r
803 \r
804           count = 0;\r
805           /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */\r
806           for (x = (yyn < 0 ? -yyn : 0);\r
807                x < (sizeof(yytname) / sizeof(char *)); x++)\r
808             if (yycheck[x + yyn] == x)\r
809               size += strlen(yytname[x]) + 15, count++;\r
810           msg = (char *) malloc(size + 15);\r
811           if (msg != 0)\r
812             {\r
813               strcpy(msg, "parse error");\r
814 \r
815               if (count < 5)\r
816                 {\r
817                   count = 0;\r
818                   for (x = (yyn < 0 ? -yyn : 0);\r
819                        x < (sizeof(yytname) / sizeof(char *)); x++)\r
820                     if (yycheck[x + yyn] == x)\r
821                       {\r
822                         strcat(msg, count == 0 ? ", expecting `" : " or `");\r
823                         strcat(msg, yytname[x]);\r
824                         strcat(msg, "'");\r
825                         count++;\r
826                       }\r
827                 }\r
828               yyerror(msg);\r
829               free(msg);\r
830             }\r
831           else\r
832             yyerror ("parse error; also virtual memory exceeded");\r
833         }\r
834       else\r
835 #endif /* YYERROR_VERBOSE */\r
836         yyerror("parse error");\r
837     }\r
838 \r
839   goto yyerrlab1;\r
840 yyerrlab1:   /* here on error raised explicitly by an action */\r
841 \r
842   if (yyerrstatus == 3)\r
843     {\r
844       /* if just tried and failed to reuse lookahead token after an error, discard it.  */\r
845 \r
846       /* return failure if at end of input */\r
847       if (yychar == YYEOF)\r
848         YYABORT;\r
849 \r
850 #if YYDEBUG != 0\r
851       if (yydebug)\r
852         fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);\r
853 #endif\r
854 \r
855       yychar = YYEMPTY;\r
856     }\r
857 \r
858   /* Else will try to reuse lookahead token\r
859      after shifting the error token.  */\r
860 \r
861   yyerrstatus = 3;              /* Each real token shifted decrements this */\r
862 \r
863   goto yyerrhandle;\r
864 \r
865 yyerrdefault:  /* current state does not do anything special for the error token. */\r
866 \r
867 #if 0\r
868   /* This is wrong; only states that explicitly want error tokens\r
869      should shift them.  */\r
870   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/\r
871   if (yyn) goto yydefault;\r
872 #endif\r
873 \r
874 yyerrpop:   /* pop the current state because it cannot handle the error token */\r
875 \r
876   if (yyssp == yyss) YYABORT;\r
877   yyvsp--;\r
878   yystate = *--yyssp;\r
879 #ifdef YYLSP_NEEDED\r
880   yylsp--;\r
881 #endif\r
882 \r
883 #if YYDEBUG != 0\r
884   if (yydebug)\r
885     {\r
886       short *ssp1 = yyss - 1;\r
887       fprintf (stderr, "Error: state stack now");\r
888       while (ssp1 != yyssp)\r
889         fprintf (stderr, " %d", *++ssp1);\r
890       fprintf (stderr, "\n");\r
891     }\r
892 #endif\r
893 \r
894 yyerrhandle:\r
895 \r
896   yyn = yypact[yystate];\r
897   if (yyn == YYFLAG)\r
898     goto yyerrdefault;\r
899 \r
900   yyn += YYTERROR;\r
901   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)\r
902     goto yyerrdefault;\r
903 \r
904   yyn = yytable[yyn];\r
905   if (yyn < 0)\r
906     {\r
907       if (yyn == YYFLAG)\r
908         goto yyerrpop;\r
909       yyn = -yyn;\r
910       goto yyreduce;\r
911     }\r
912   else if (yyn == 0)\r
913     goto yyerrpop;\r
914 \r
915   if (yyn == YYFINAL)\r
916     YYACCEPT;\r
917 \r
918 #if YYDEBUG != 0\r
919   if (yydebug)\r
920     fprintf(stderr, "Shifting error token, ");\r
921 #endif\r
922 \r
923   *++yyvsp = yylval;\r
924 #ifdef YYLSP_NEEDED\r
925   *++yylsp = yylloc;\r
926 #endif\r
927 \r
928   yystate = yyn;\r
929   goto yynewstate;\r
930 }\r
931 #line 98 "schema.y"\r
932 \r
933 \r