Add new udafs and RMR support to gsprintconsole_ves
[com/gs-lite.git] / src / ftacmp / partn.tab.cc
1 /* A Bison parser, made from partn.y, by GNU bison 1.75.  */
2
3 /* Skeleton parser for Yacc-like parsing with Bison,
4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2, or (at your option)
9    any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place - Suite 330,
19    Boston, MA 02111-1307, USA.  */
20
21 /* As a special exception, when this file is copied by Bison into a
22    Bison output file, you may use that output file without restriction.
23    This special exception was added by the Free Software Foundation
24    in version 1.24 of Bison.  */
25
26 /* Written by Richard Stallman by simplifying the original so called
27    ``semantic'' parser.  */
28
29 /* All symbols defined below should begin with yy or YY, to avoid
30    infringing on user name space.  This should be done even for local
31    variables, as they might otherwise be expanded by user macros.
32    There are some unavoidable exceptions within include files to
33    define necessary library symbols; they are noted "INFRINGES ON
34    USER NAME SPACE" below.  */
35
36 /* Identify Bison output.  */
37 #define YYBISON 1
38
39 /* Pure parsers.  */
40 #define YYPURE  0
41
42 /* Using locations.  */
43 #define YYLSP_NEEDED 0
44
45 /* If NAME_PREFIX is specified substitute the variables and functions
46    names.  */
47 #define yyparse PartnParserparse
48 #define yylex   PartnParserlex
49 #define yyerror PartnParsererror
50 #define yylval  PartnParserlval
51 #define yychar  PartnParserchar
52 #define yydebug PartnParserdebug
53 #define yynerrs PartnParsernerrs
54
55
56 /* Tokens.  */
57 #ifndef YYTOKENTYPE
58 # define YYTOKENTYPE
59    /* Put the tokens into the symbol table, so that GDB and other debuggers
60       know about them.  */
61    enum yytokentype {
62      NAME = 258,
63      STRING_TOKEN = 259,
64      INTNUM = 260,
65      LONGINTNUM = 261,
66      UMINUS = 262,
67      HEX_L = 263,
68      LHEX_L = 264,
69      IP_L = 265
70    };
71 #endif
72 #define NAME 258
73 #define STRING_TOKEN 259
74 #define INTNUM 260
75 #define LONGINTNUM 261
76 #define UMINUS 262
77 #define HEX_L 263
78 #define LHEX_L 264
79 #define IP_L 265
80
81
82
83
84 /* Copy the first part of user declarations.  */
85 #line 8 "partn.y"
86
87
88
89 #include <stdio.h>
90
91 /*              Some addn'l includes, necessary but not included by the
92                 bison generated code.
93 */
94
95 #include <stdlib.h>
96
97 /*              prototypes for the parser callbacks.
98 */
99
100 #include "parse_partn.h"
101
102 extern partn_def_list_t *partn_parse_result;
103
104
105 #define YYDEBUG 1
106
107
108
109 /* Enabling traces.  */
110 #ifndef YYDEBUG
111 # define YYDEBUG 0
112 #endif
113
114 /* Enabling verbose error messages.  */
115 #ifdef YYERROR_VERBOSE
116 # undef YYERROR_VERBOSE
117 # define YYERROR_VERBOSE 1
118 #else
119 # define YYERROR_VERBOSE 0
120 #endif
121
122 #ifndef YYSTYPE
123 #line 34 "partn.y"
124 typedef union {
125         int intval;
126         double floatval;
127         char *strval;
128         int subtok;
129
130 /*                      for FTA definition.     */
131         literal_t *litval;
132         scalarexp_t *scalarval;
133         se_list_t *se_listval;
134         colref_t *colref;
135         partn_def_list_t *pdl;
136         partn_def_t *pd;
137 } yystype;
138 /* Line 193 of /usr/local/share/bison/yacc.c.  */
139 #line 140 "partn.tab.cc"
140 # define YYSTYPE yystype
141 # define YYSTYPE_IS_TRIVIAL 1
142 #endif
143
144 #ifndef YYLTYPE
145 typedef struct yyltype
146 {
147   int first_line;
148   int first_column;
149   int last_line;
150   int last_column;
151 } yyltype;
152 # define YYLTYPE yyltype
153 # define YYLTYPE_IS_TRIVIAL 1
154 #endif
155
156 /* Copy the second part of user declarations.  */
157
158
159 /* Line 213 of /usr/local/share/bison/yacc.c.  */
160 #line 161 "partn.tab.cc"
161
162 #if ! defined (yyoverflow) || YYERROR_VERBOSE
163
164 /* The parser invokes alloca or malloc; define the necessary symbols.  */
165
166 # if YYSTACK_USE_ALLOCA
167 #  define YYSTACK_ALLOC alloca
168 # else
169 #  ifndef YYSTACK_USE_ALLOCA
170 #   if defined (alloca) || defined (_ALLOCA_H)
171 #    define YYSTACK_ALLOC alloca
172 #   else
173 #    ifdef __GNUC__
174 #     define YYSTACK_ALLOC __builtin_alloca
175 #    endif
176 #   endif
177 #  endif
178 # endif
179
180 # ifdef YYSTACK_ALLOC
181    /* Pacify GCC's `empty if-body' warning. */
182 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
183 # else
184 #  if defined (__STDC__) || defined (__cplusplus)
185 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
186 #   define YYSIZE_T size_t
187 #  endif
188 #  define YYSTACK_ALLOC malloc
189 #  define YYSTACK_FREE free
190 # endif
191 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
192
193
194 #if (! defined (yyoverflow) \
195      && (! defined (__cplusplus) \
196          || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
197
198 /* A type that is properly aligned for any stack member.  */
199 union yyalloc
200 {
201   short yyss;
202   YYSTYPE yyvs;
203   };
204
205 /* The size of the maximum gap between one aligned stack and the next.  */
206 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
207
208 /* The size of an array large to enough to hold all stacks, each with
209    N elements.  */
210 # define YYSTACK_BYTES(N) \
211      ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
212       + YYSTACK_GAP_MAX)
213
214 /* Copy COUNT objects from FROM to TO.  The source and destination do
215    not overlap.  */
216 # ifndef YYCOPY
217 #  if 1 < __GNUC__
218 #   define YYCOPY(To, From, Count) \
219       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
220 #  else
221 #   define YYCOPY(To, From, Count)              \
222       do                                        \
223         {                                       \
224           register YYSIZE_T yyi;                \
225           for (yyi = 0; yyi < (Count); yyi++)   \
226             (To)[yyi] = (From)[yyi];    \
227         }                                       \
228       while (0)
229 #  endif
230 # endif
231
232 /* Relocate STACK from its old location to the new one.  The
233    local variables YYSIZE and YYSTACKSIZE give the old and new number of
234    elements in the stack, and YYPTR gives the new location of the
235    stack.  Advance YYPTR to a properly aligned location for the next
236    stack.  */
237 # define YYSTACK_RELOCATE(Stack)                                        \
238     do                                                                  \
239       {                                                                 \
240         YYSIZE_T yynewbytes;                                            \
241         YYCOPY (&yyptr->Stack, Stack, yysize);                          \
242         Stack = &yyptr->Stack;                                          \
243         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;   \
244         yyptr += yynewbytes / sizeof (*yyptr);                          \
245       }                                                                 \
246     while (0)
247
248 #endif
249
250 #if defined (__STDC__) || defined (__cplusplus)
251    typedef signed char yysigned_char;
252 #else
253    typedef short yysigned_char;
254 #endif
255
256 /* YYFINAL -- State number of the termination state. */
257 #define YYFINAL  6
258 #define YYLAST   55
259
260 /* YYNTOKENS -- Number of terminals. */
261 #define YYNTOKENS  23
262 /* YYNNTS -- Number of nonterminals. */
263 #define YYNNTS  8
264 /* YYNRULES -- Number of rules. */
265 #define YYNRULES  24
266 /* YYNRULES -- Number of states. */
267 #define YYNSTATES  47
268
269 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
270 #define YYUNDEFTOK  2
271 #define YYMAXUTOK   265
272
273 #define YYTRANSLATE(X) \
274   ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
275
276 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
277 static const unsigned char yytranslate[] =
278 {
279        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
280        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
281        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
282        2,     2,     2,     2,     2,     2,     2,     2,     8,     2,
283       20,    21,    11,     9,    22,    10,     2,    12,     2,     2,
284        2,     2,     2,     2,     2,     2,     2,     2,    19,     2,
285        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
286        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
287        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
288        2,    17,     2,    18,     2,     2,     2,     2,     2,     2,
289        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
290        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
291        2,     2,     2,     2,     7,     2,     2,     2,     2,     2,
292        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
293        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
294        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
295        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
296        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
297        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
298        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
299        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
300        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
301        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
302        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
303        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
304        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
305        5,     6,    13,    14,    15,    16
306 };
307
308 #if YYDEBUG
309 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
310    YYRHS.  */
311 static const unsigned char yyprhs[] =
312 {
313        0,     0,     3,     5,     7,    10,    19,    23,    27,    31,
314       35,    39,    43,    46,    49,    51,    53,    57,    59,    63,
315       65,    67,    70,    73,    76
316 };
317
318 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
319 static const yysigned_char yyrhs[] =
320 {
321       24,     0,    -1,    25,    -1,    26,    -1,    25,    26,    -1,
322        3,    17,     3,    18,    19,    20,    28,    21,    -1,    27,
323        9,    27,    -1,    27,    10,    27,    -1,    27,     7,    27,
324       -1,    27,    11,    27,    -1,    27,    12,    27,    -1,    27,
325        8,    27,    -1,     9,    27,    -1,    10,    27,    -1,    29,
326       -1,    30,    -1,    20,    27,    21,    -1,    27,    -1,    28,
327       22,    27,    -1,     5,    -1,     6,    -1,    14,     4,    -1,
328       15,     4,    -1,    16,     4,    -1,     3,    -1
329 };
330
331 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
332 static const unsigned char yyrline[] =
333 {
334        0,    75,    75,    81,    83,    86,    91,    93,    94,    95,
335       96,    97,    98,    99,   100,   101,   102,   105,   107,   110,
336      112,   113,   114,   115,   119
337 };
338 #endif
339
340 #if YYDEBUG || YYERROR_VERBOSE
341 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
342    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
343 static const char *const yytname[] =
344 {
345   "$end", "error", "$undefined", "NAME", "STRING_TOKEN", "INTNUM", 
346   "LONGINTNUM", "'|'", "'&'", "'+'", "'-'", "'*'", "'/'", "UMINUS", 
347   "HEX_L", "LHEX_L", "IP_L", "'['", "']'", "':'", "'('", "')'", "','", 
348   "$accept", "parse_result", "partn_def_list", "partn_def", "scalar_exp", 
349   "scalar_exp_commalist", "literal", "column_ref", 0
350 };
351 #endif
352
353 # ifdef YYPRINT
354 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
355    token YYLEX-NUM.  */
356 static const unsigned short yytoknum[] =
357 {
358        0,   256,   257,   258,   259,   260,   261,   124,    38,    43,
359       45,    42,    47,   262,   263,   264,   265,    91,    93,    58,
360       40,    41,    44
361 };
362 # endif
363
364 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
365 static const unsigned char yyr1[] =
366 {
367        0,    23,    24,    25,    25,    26,    27,    27,    27,    27,
368       27,    27,    27,    27,    27,    27,    27,    28,    28,    29,
369       29,    29,    29,    29,    30
370 };
371
372 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
373 static const unsigned char yyr2[] =
374 {
375        0,     2,     1,     1,     2,     8,     3,     3,     3,     3,
376        3,     3,     2,     2,     1,     1,     3,     1,     3,     1,
377        1,     2,     2,     2,     1
378 };
379
380 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
381    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
382    means the default is an error.  */
383 static const unsigned char yydefact[] =
384 {
385        0,     0,     0,     2,     3,     0,     1,     4,     0,     0,
386        0,     0,    24,    19,    20,     0,     0,     0,     0,     0,
387        0,    17,     0,    14,    15,    12,    13,    21,    22,    23,
388        0,     0,     0,     0,     0,     0,     0,     5,     0,    16,
389        8,    11,     6,     7,     9,    10,    18
390 };
391
392 /* YYDEFGOTO[NTERM-NUM]. */
393 static const yysigned_char yydefgoto[] =
394 {
395       -1,     2,     3,     4,    21,    22,    23,    24
396 };
397
398 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
399    STATE-NUM.  */
400 #define YYPACT_NINF -20
401 static const yysigned_char yypact[] =
402 {
403        1,    13,    31,     1,   -20,    29,   -20,   -20,    18,    32,
404       17,    19,   -20,   -20,   -20,    19,    19,    34,    48,    49,
405       19,    -1,   -19,   -20,   -20,   -20,   -20,   -20,   -20,   -20,
406       33,    19,    19,    19,    19,    19,    19,   -20,    19,   -20,
407       38,     3,    15,    15,   -20,   -20,    -1
408 };
409
410 /* YYPGOTO[NTERM-NUM].  */
411 static const yysigned_char yypgoto[] =
412 {
413      -20,   -20,   -20,    52,   -15,   -20,   -20,   -20
414 };
415
416 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
417    positive, shift that token.  If negative, reduce the rule which
418    number is the opposite.  If zero, do what YYDEFACT says.
419    If YYTABLE_NINF, parse error.  */
420 #define YYTABLE_NINF -1
421 static const unsigned char yytable[] =
422 {
423       25,    26,    37,    38,     1,    30,    31,    32,    33,    34,
424       35,    36,    33,    34,    35,    36,    40,    41,    42,    43,
425       44,    45,    12,    46,    13,    14,    35,    36,    15,    16,
426        5,     6,     8,    17,    18,    19,     9,    11,    27,    20,
427       31,    32,    33,    34,    35,    36,    32,    33,    34,    35,
428       36,    10,    28,    29,    39,     7
429 };
430
431 static const unsigned char yycheck[] =
432 {
433       15,    16,    21,    22,     3,    20,     7,     8,     9,    10,
434       11,    12,     9,    10,    11,    12,    31,    32,    33,    34,
435       35,    36,     3,    38,     5,     6,    11,    12,     9,    10,
436       17,     0,     3,    14,    15,    16,    18,    20,     4,    20,
437        7,     8,     9,    10,    11,    12,     8,     9,    10,    11,
438       12,    19,     4,     4,    21,     3
439 };
440
441 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
442    symbol of state STATE-NUM.  */
443 static const unsigned char yystos[] =
444 {
445        0,     3,    24,    25,    26,    17,     0,    26,     3,    18,
446       19,    20,     3,     5,     6,     9,    10,    14,    15,    16,
447       20,    27,    28,    29,    30,    27,    27,     4,     4,     4,
448       27,     7,     8,     9,    10,    11,    12,    21,    22,    21,
449       27,    27,    27,    27,    27,    27,    27
450 };
451
452 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
453 # define YYSIZE_T __SIZE_TYPE__
454 #endif
455 #if ! defined (YYSIZE_T) && defined (size_t)
456 # define YYSIZE_T size_t
457 #endif
458 #if ! defined (YYSIZE_T)
459 # if defined (__STDC__) || defined (__cplusplus)
460 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
461 #  define YYSIZE_T size_t
462 # endif
463 #endif
464 #if ! defined (YYSIZE_T)
465 # define YYSIZE_T unsigned int
466 #endif
467
468 #define yyerrok         (yyerrstatus = 0)
469 #define yyclearin       (yychar = YYEMPTY)
470 #define YYEMPTY         -2
471 #define YYEOF           0
472
473 #define YYACCEPT        goto yyacceptlab
474 #define YYABORT         goto yyabortlab
475 #define YYERROR         goto yyerrlab1
476
477 /* Like YYERROR except do call yyerror.  This remains here temporarily
478    to ease the transition to the new meaning of YYERROR, for GCC.
479    Once GCC version 2 has supplanted version 1, this can go.  */
480
481 #define YYFAIL          goto yyerrlab
482
483 #define YYRECOVERING()  (!!yyerrstatus)
484
485 #define YYBACKUP(Token, Value)                                  \
486 do                                                              \
487   if (yychar == YYEMPTY && yylen == 1)                          \
488     {                                                           \
489       yychar = (Token);                                         \
490       yylval = (Value);                                         \
491       yychar1 = YYTRANSLATE (yychar);                           \
492       YYPOPSTACK;                                               \
493       goto yybackup;                                            \
494     }                                                           \
495   else                                                          \
496     {                                                           \
497       yyerror ("syntax error: cannot back up");                 \
498       YYERROR;                                                  \
499     }                                                           \
500 while (0)
501
502 #define YYTERROR        1
503 #define YYERRCODE       256
504
505 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
506    are run).  */
507
508 #ifndef YYLLOC_DEFAULT
509 # define YYLLOC_DEFAULT(Current, Rhs, N)           \
510   Current.first_line   = Rhs[1].first_line;      \
511   Current.first_column = Rhs[1].first_column;    \
512   Current.last_line    = Rhs[N].last_line;       \
513   Current.last_column  = Rhs[N].last_column;
514 #endif
515
516 /* YYLEX -- calling `yylex' with the right arguments.  */
517
518 #define YYLEX   yylex ()
519
520 /* Enable debugging if requested.  */
521 #if YYDEBUG
522
523 # ifndef YYFPRINTF
524 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
525 #  define YYFPRINTF fprintf
526 # endif
527
528 # define YYDPRINTF(Args)                        \
529 do {                                            \
530   if (yydebug)                                  \
531     YYFPRINTF Args;                             \
532 } while (0)
533 # define YYDSYMPRINT(Args)                      \
534 do {                                            \
535   if (yydebug)                                  \
536     yysymprint Args;                            \
537 } while (0)
538 /* Nonzero means print parse trace.  It is left uninitialized so that
539    multiple parsers can coexist.  */
540 int yydebug;
541 #else /* !YYDEBUG */
542 # define YYDPRINTF(Args)
543 # define YYDSYMPRINT(Args)
544 #endif /* !YYDEBUG */
545
546 /* YYINITDEPTH -- initial size of the parser's stacks.  */
547 #ifndef YYINITDEPTH
548 # define YYINITDEPTH 200
549 #endif
550
551 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
552    if the built-in stack extension method is used).
553
554    Do not make this value too large; the results are undefined if
555    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
556    evaluated with infinite-precision integer arithmetic.  */
557
558 #if YYMAXDEPTH == 0
559 # undef YYMAXDEPTH
560 #endif
561
562 #ifndef YYMAXDEPTH
563 # define YYMAXDEPTH 10000
564 #endif
565
566 \f
567
568 #if YYERROR_VERBOSE
569
570 # ifndef yystrlen
571 #  if defined (__GLIBC__) && defined (_STRING_H)
572 #   define yystrlen strlen
573 #  else
574 /* Return the length of YYSTR.  */
575 static YYSIZE_T
576 #   if defined (__STDC__) || defined (__cplusplus)
577 yystrlen (const char *yystr)
578 #   else
579 yystrlen (yystr)
580      const char *yystr;
581 #   endif
582 {
583   register const char *yys = yystr;
584
585   while (*yys++ != '\0')
586     continue;
587
588   return yys - yystr - 1;
589 }
590 #  endif
591 # endif
592
593 # ifndef yystpcpy
594 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
595 #   define yystpcpy stpcpy
596 #  else
597 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
598    YYDEST.  */
599 static char *
600 #   if defined (__STDC__) || defined (__cplusplus)
601 yystpcpy (char *yydest, const char *yysrc)
602 #   else
603 yystpcpy (yydest, yysrc)
604      char *yydest;
605      const char *yysrc;
606 #   endif
607 {
608   register char *yyd = yydest;
609   register const char *yys = yysrc;
610
611   while ((*yyd++ = *yys++) != '\0')
612     continue;
613
614   return yyd - 1;
615 }
616 #  endif
617 # endif
618
619 #endif /* !YYERROR_VERBOSE */
620
621 \f
622
623 #if YYDEBUG
624 /*-----------------------------.
625 | Print this symbol on YYOUT.  |
626 `-----------------------------*/
627
628 static void
629 #if defined (__STDC__) || defined (__cplusplus)
630 yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)
631 #else
632 yysymprint (yyout, yytype, yyvalue)
633     FILE* yyout;
634     int yytype;
635     YYSTYPE yyvalue;
636 #endif
637 {
638   /* Pacify ``unused variable'' warnings.  */
639   (void) yyvalue;
640
641   if (yytype < YYNTOKENS)
642     {
643       YYFPRINTF (yyout, "token %s (", yytname[yytype]);
644 # ifdef YYPRINT
645       YYPRINT (yyout, yytoknum[yytype], yyvalue);
646 # endif
647     }
648   else
649     YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);
650
651   switch (yytype)
652     {
653       default:
654         break;
655     }
656   YYFPRINTF (yyout, ")");
657 }
658 #endif /* YYDEBUG. */
659
660
661 /*-----------------------------------------------.
662 | Release the memory associated to this symbol.  |
663 `-----------------------------------------------*/
664
665 static void
666 #if defined (__STDC__) || defined (__cplusplus)
667 yydestruct (int yytype, YYSTYPE yyvalue)
668 #else
669 yydestruct (yytype, yyvalue)
670     int yytype;
671     YYSTYPE yyvalue;
672 #endif
673 {
674   /* Pacify ``unused variable'' warnings.  */
675   (void) yyvalue;
676
677   switch (yytype)
678     {
679       default:
680         break;
681     }
682 }
683
684 \f
685
686 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
687    into yyparse.  The argument should have type void *.
688    It should actually point to an object.
689    Grammar actions can access the variable by casting it
690    to the proper pointer type.  */
691
692 #ifdef YYPARSE_PARAM
693 # if defined (__STDC__) || defined (__cplusplus)
694 #  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
695 #  define YYPARSE_PARAM_DECL
696 # else
697 #  define YYPARSE_PARAM_ARG YYPARSE_PARAM
698 #  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
699 # endif
700 #else /* !YYPARSE_PARAM */
701 # define YYPARSE_PARAM_ARG
702 # define YYPARSE_PARAM_DECL
703 #endif /* !YYPARSE_PARAM */
704
705 /* Prevent warning if -Wstrict-prototypes.  */
706 #ifdef __GNUC__
707 # ifdef YYPARSE_PARAM
708 int yyparse (void *);
709 # else
710 int yyparse (void);
711 # endif
712 #endif
713
714
715 /* The lookahead symbol.  */
716 int yychar;
717
718 /* The semantic value of the lookahead symbol.  */
719 YYSTYPE yylval;
720
721 /* Number of parse errors so far.  */
722 int yynerrs;
723
724
725 int
726 yyparse (YYPARSE_PARAM_ARG)
727      YYPARSE_PARAM_DECL
728 {
729   
730   register int yystate;
731   register int yyn;
732   int yyresult;
733   /* Number of tokens to shift before error messages enabled.  */
734   int yyerrstatus;
735   /* Lookahead token as an internal (translated) token number.  */
736   int yychar1 = 0;
737
738   /* Three stacks and their tools:
739      `yyss': related to states,
740      `yyvs': related to semantic values,
741      `yyls': related to locations.
742
743      Refer to the stacks thru separate pointers, to allow yyoverflow
744      to reallocate them elsewhere.  */
745
746   /* The state stack.  */
747   short yyssa[YYINITDEPTH];
748   short *yyss = yyssa;
749   register short *yyssp;
750
751   /* The semantic value stack.  */
752   YYSTYPE yyvsa[YYINITDEPTH];
753   YYSTYPE *yyvs = yyvsa;
754   register YYSTYPE *yyvsp;
755
756
757
758 #define YYPOPSTACK   (yyvsp--, yyssp--)
759
760   YYSIZE_T yystacksize = YYINITDEPTH;
761
762   /* The variables used to return semantic value and location from the
763      action routines.  */
764   YYSTYPE yyval;
765
766
767   /* When reducing, the number of symbols on the RHS of the reduced
768      rule.  */
769   int yylen;
770
771   YYDPRINTF ((stderr, "Starting parse\n"));
772
773   yystate = 0;
774   yyerrstatus = 0;
775   yynerrs = 0;
776   yychar = YYEMPTY;             /* Cause a token to be read.  */
777
778   /* Initialize stack pointers.
779      Waste one element of value and location stack
780      so that they stay on the same level as the state stack.
781      The wasted elements are never initialized.  */
782
783   yyssp = yyss;
784   yyvsp = yyvs;
785
786   goto yysetstate;
787
788 /*------------------------------------------------------------.
789 | yynewstate -- Push a new state, which is found in yystate.  |
790 `------------------------------------------------------------*/
791  yynewstate:
792   /* In all cases, when you get here, the value and location stacks
793      have just been pushed. so pushing a state here evens the stacks.
794      */
795   yyssp++;
796
797  yysetstate:
798   *yyssp = yystate;
799
800   if (yyssp >= yyss + yystacksize - 1)
801     {
802       /* Get the current used size of the three stacks, in elements.  */
803       YYSIZE_T yysize = yyssp - yyss + 1;
804
805 #ifdef yyoverflow
806       {
807         /* Give user a chance to reallocate the stack. Use copies of
808            these so that the &'s don't force the real ones into
809            memory.  */
810         YYSTYPE *yyvs1 = yyvs;
811         short *yyss1 = yyss;
812
813
814         /* Each stack pointer address is followed by the size of the
815            data in use in that stack, in bytes.  This used to be a
816            conditional around just the two extra args, but that might
817            be undefined if yyoverflow is a macro.  */
818         yyoverflow ("parser stack overflow",
819                     &yyss1, yysize * sizeof (*yyssp),
820                     &yyvs1, yysize * sizeof (*yyvsp),
821
822                     &yystacksize);
823
824         yyss = yyss1;
825         yyvs = yyvs1;
826       }
827 #else /* no yyoverflow */
828 # ifndef YYSTACK_RELOCATE
829       goto yyoverflowlab;
830 # else
831       /* Extend the stack our own way.  */
832       if (yystacksize >= YYMAXDEPTH)
833         goto yyoverflowlab;
834       yystacksize *= 2;
835       if (yystacksize > YYMAXDEPTH)
836         yystacksize = YYMAXDEPTH;
837
838       {
839         short *yyss1 = yyss;
840         union yyalloc *yyptr =
841           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
842         if (! yyptr)
843           goto yyoverflowlab;
844         YYSTACK_RELOCATE (yyss);
845         YYSTACK_RELOCATE (yyvs);
846
847 #  undef YYSTACK_RELOCATE
848         if (yyss1 != yyssa)
849           YYSTACK_FREE (yyss1);
850       }
851 # endif
852 #endif /* no yyoverflow */
853
854       yyssp = yyss + yysize - 1;
855       yyvsp = yyvs + yysize - 1;
856
857
858       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
859                   (unsigned long int) yystacksize));
860
861       if (yyssp >= yyss + yystacksize - 1)
862         YYABORT;
863     }
864
865   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
866
867   goto yybackup;
868
869 /*-----------.
870 | yybackup.  |
871 `-----------*/
872 yybackup:
873
874 /* Do appropriate processing given the current state.  */
875 /* Read a lookahead token if we need one and don't already have one.  */
876 /* yyresume: */
877
878   /* First try to decide what to do without reference to lookahead token.  */
879
880   yyn = yypact[yystate];
881   if (yyn == YYPACT_NINF)
882     goto yydefault;
883
884   /* Not known => get a lookahead token if don't already have one.  */
885
886   /* yychar is either YYEMPTY or YYEOF
887      or a valid token in external form.  */
888
889   if (yychar == YYEMPTY)
890     {
891       YYDPRINTF ((stderr, "Reading a token: "));
892       yychar = YYLEX;
893     }
894
895   /* Convert token to internal form (in yychar1) for indexing tables with.  */
896
897   if (yychar <= 0)              /* This means end of input.  */
898     {
899       yychar1 = 0;
900       yychar = YYEOF;           /* Don't call YYLEX any more.  */
901
902       YYDPRINTF ((stderr, "Now at end of input.\n"));
903     }
904   else
905     {
906       yychar1 = YYTRANSLATE (yychar);
907
908       /* We have to keep this `#if YYDEBUG', since we use variables
909          which are defined only if `YYDEBUG' is set.  */
910       YYDPRINTF ((stderr, "Next token is "));
911       YYDSYMPRINT ((stderr, yychar1, yylval));
912       YYDPRINTF ((stderr, "\n"));
913     }
914
915   /* If the proper action on seeing token YYCHAR1 is to reduce or to
916      detect an error, take that action.  */
917   yyn += yychar1;
918   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
919     goto yydefault;
920   yyn = yytable[yyn];
921   if (yyn <= 0)
922     {
923       if (yyn == 0 || yyn == YYTABLE_NINF)
924         goto yyerrlab;
925       yyn = -yyn;
926       goto yyreduce;
927     }
928
929   if (yyn == YYFINAL)
930     YYACCEPT;
931
932   /* Shift the lookahead token.  */
933   YYDPRINTF ((stderr, "Shifting token %d (%s), ",
934               yychar, yytname[yychar1]));
935
936   /* Discard the token being shifted unless it is eof.  */
937   if (yychar != YYEOF)
938     yychar = YYEMPTY;
939
940   *++yyvsp = yylval;
941
942
943   /* Count tokens shifted since error; after three, turn off error
944      status.  */
945   if (yyerrstatus)
946     yyerrstatus--;
947
948   yystate = yyn;
949   goto yynewstate;
950
951
952 /*-----------------------------------------------------------.
953 | yydefault -- do the default action for the current state.  |
954 `-----------------------------------------------------------*/
955 yydefault:
956   yyn = yydefact[yystate];
957   if (yyn == 0)
958     goto yyerrlab;
959   goto yyreduce;
960
961
962 /*-----------------------------.
963 | yyreduce -- Do a reduction.  |
964 `-----------------------------*/
965 yyreduce:
966   /* yyn is the number of a rule to reduce with.  */
967   yylen = yyr2[yyn];
968
969   /* If YYLEN is nonzero, implement the default value of the action:
970      `$$ = $1'.
971
972      Otherwise, the following line sets YYVAL to garbage.
973      This behavior is undocumented and Bison
974      users should not rely upon it.  Assigning to YYVAL
975      unconditionally makes the parser a bit smaller, and it avoids a
976      GCC warning that YYVAL may be used uninitialized.  */
977   yyval = yyvsp[1-yylen];
978
979
980
981 #if YYDEBUG
982   /* We have to keep this `#if YYDEBUG', since we use variables which
983      are defined only if `YYDEBUG' is set.  */
984   if (yydebug)
985     {
986       int yyi;
987
988       YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
989                  yyn - 1, yyrline[yyn]);
990
991       /* Print the symbols being reduced, and their result.  */
992       for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
993         YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
994       YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
995     }
996 #endif
997   switch (yyn)
998     {
999         case 2:
1000 #line 75 "partn.y"
1001     {
1002                 partn_parse_result = yyvsp[0].pdl;
1003         }
1004     break;
1005
1006   case 3:
1007 #line 82 "partn.y"
1008     {yyval.pdl = new partn_def_list_t(yyvsp[0].pd);}
1009     break;
1010
1011   case 4:
1012 #line 83 "partn.y"
1013     {yyval.pdl=yyvsp[-1].pdl->append(yyvsp[0].pd);}
1014     break;
1015
1016   case 5:
1017 #line 88 "partn.y"
1018     {yyval.pd = new partn_def_t(yyvsp[-7].strval,yyvsp[-5].strval,yyvsp[-1].se_listval);}
1019     break;
1020
1021   case 6:
1022 #line 92 "partn.y"
1023     { yyval.scalarval=new scalarexp_t("+",yyvsp[-2].scalarval,yyvsp[0].scalarval);}
1024     break;
1025
1026   case 7:
1027 #line 93 "partn.y"
1028     { yyval.scalarval=new scalarexp_t("-",yyvsp[-2].scalarval,yyvsp[0].scalarval);}
1029     break;
1030
1031   case 8:
1032 #line 94 "partn.y"
1033     { yyval.scalarval=new scalarexp_t("|",yyvsp[-2].scalarval,yyvsp[0].scalarval);}
1034     break;
1035
1036   case 9:
1037 #line 95 "partn.y"
1038     { yyval.scalarval=new scalarexp_t("*",yyvsp[-2].scalarval,yyvsp[0].scalarval);}
1039     break;
1040
1041   case 10:
1042 #line 96 "partn.y"
1043     { yyval.scalarval=new scalarexp_t("/",yyvsp[-2].scalarval,yyvsp[0].scalarval);}
1044     break;
1045
1046   case 11:
1047 #line 97 "partn.y"
1048     { yyval.scalarval=new scalarexp_t("&",yyvsp[-2].scalarval,yyvsp[0].scalarval);}
1049     break;
1050
1051   case 12:
1052 #line 98 "partn.y"
1053     { yyval.scalarval = new scalarexp_t("+",yyvsp[0].scalarval);}
1054     break;
1055
1056   case 13:
1057 #line 99 "partn.y"
1058     { yyval.scalarval = new scalarexp_t("-",yyvsp[0].scalarval);}
1059     break;
1060
1061   case 14:
1062 #line 100 "partn.y"
1063     { yyval.scalarval= new scalarexp_t(yyvsp[0].litval);}
1064     break;
1065
1066   case 15:
1067 #line 101 "partn.y"
1068     { yyval.scalarval = new scalarexp_t(yyvsp[0].colref);}
1069     break;
1070
1071   case 16:
1072 #line 102 "partn.y"
1073     {yyval.scalarval = yyvsp[-1].scalarval;}
1074     break;
1075
1076   case 17:
1077 #line 106 "partn.y"
1078     {   yyval.se_listval= new se_list_t(yyvsp[0].scalarval); }
1079     break;
1080
1081   case 18:
1082 #line 107 "partn.y"
1083     { yyval.se_listval=yyvsp[-2].se_listval->append(yyvsp[0].scalarval); }
1084     break;
1085
1086   case 19:
1087 #line 111 "partn.y"
1088     {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_INT);}
1089     break;
1090
1091   case 20:
1092 #line 112 "partn.y"
1093     {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_LONGINT);}
1094     break;
1095
1096   case 21:
1097 #line 113 "partn.y"
1098     {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_HEX);}
1099     break;
1100
1101   case 22:
1102 #line 114 "partn.y"
1103     {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_LONGHEX);}
1104     break;
1105
1106   case 23:
1107 #line 115 "partn.y"
1108     {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_IP);}
1109     break;
1110
1111   case 24:
1112 #line 120 "partn.y"
1113     {yyval.colref = new colref_t(yyvsp[0].strval); }
1114     break;
1115
1116
1117     }
1118
1119 /* Line 1016 of /usr/local/share/bison/yacc.c.  */
1120 #line 1121 "partn.tab.cc"
1121 \f
1122   yyvsp -= yylen;
1123   yyssp -= yylen;
1124
1125
1126 #if YYDEBUG
1127   if (yydebug)
1128     {
1129       short *yyssp1 = yyss - 1;
1130       YYFPRINTF (stderr, "state stack now");
1131       while (yyssp1 != yyssp)
1132         YYFPRINTF (stderr, " %d", *++yyssp1);
1133       YYFPRINTF (stderr, "\n");
1134     }
1135 #endif
1136
1137   *++yyvsp = yyval;
1138
1139
1140   /* Now `shift' the result of the reduction.  Determine what state
1141      that goes to, based on the state we popped back to and the rule
1142      number reduced by.  */
1143
1144   yyn = yyr1[yyn];
1145
1146   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1147   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1148     yystate = yytable[yystate];
1149   else
1150     yystate = yydefgoto[yyn - YYNTOKENS];
1151
1152   goto yynewstate;
1153
1154
1155 /*------------------------------------.
1156 | yyerrlab -- here on detecting error |
1157 `------------------------------------*/
1158 yyerrlab:
1159   /* If not already recovering from an error, report this error.  */
1160   if (!yyerrstatus)
1161     {
1162       ++yynerrs;
1163 #if YYERROR_VERBOSE
1164       yyn = yypact[yystate];
1165
1166       if (YYPACT_NINF < yyn && yyn < YYLAST)
1167         {
1168           YYSIZE_T yysize = 0;
1169           int yytype = YYTRANSLATE (yychar);
1170           char *yymsg;
1171           int yyx, yycount;
1172
1173           yycount = 0;
1174           /* Start YYX at -YYN if negative to avoid negative indexes in
1175              YYCHECK.  */
1176           for (yyx = yyn < 0 ? -yyn : 0;
1177                yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1178             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1179               yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1180           yysize += yystrlen ("parse error, unexpected ") + 1;
1181           yysize += yystrlen (yytname[yytype]);
1182           yymsg = (char *) YYSTACK_ALLOC (yysize);
1183           if (yymsg != 0)
1184             {
1185               char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1186               yyp = yystpcpy (yyp, yytname[yytype]);
1187
1188               if (yycount < 5)
1189                 {
1190                   yycount = 0;
1191                   for (yyx = yyn < 0 ? -yyn : 0;
1192                        yyx < (int) (sizeof (yytname) / sizeof (char *));
1193                        yyx++)
1194                     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1195                       {
1196                         const char *yyq = ! yycount ? ", expecting " : " or ";
1197                         yyp = yystpcpy (yyp, yyq);
1198                         yyp = yystpcpy (yyp, yytname[yyx]);
1199                         yycount++;
1200                       }
1201                 }
1202               yyerror (yymsg);
1203               YYSTACK_FREE (yymsg);
1204             }
1205           else
1206             yyerror ("parse error; also virtual memory exhausted");
1207         }
1208       else
1209 #endif /* YYERROR_VERBOSE */
1210         yyerror ("parse error");
1211     }
1212   goto yyerrlab1;
1213
1214
1215 /*----------------------------------------------------.
1216 | yyerrlab1 -- error raised explicitly by an action.  |
1217 `----------------------------------------------------*/
1218 yyerrlab1:
1219   if (yyerrstatus == 3)
1220     {
1221       /* If just tried and failed to reuse lookahead token after an
1222          error, discard it.  */
1223
1224       /* Return failure if at end of input.  */
1225       if (yychar == YYEOF)
1226         {
1227           /* Pop the error token.  */
1228           YYPOPSTACK;
1229           /* Pop the rest of the stack.  */
1230           while (yyssp > yyss)
1231             {
1232               YYDPRINTF ((stderr, "Error: popping "));
1233               YYDSYMPRINT ((stderr,
1234                             yystos[*yyssp],
1235                             *yyvsp));
1236               YYDPRINTF ((stderr, "\n"));
1237               yydestruct (yystos[*yyssp], *yyvsp);
1238               YYPOPSTACK;
1239             }
1240           YYABORT;
1241         }
1242
1243       YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1244                   yychar, yytname[yychar1]));
1245       yydestruct (yychar1, yylval);
1246       yychar = YYEMPTY;
1247     }
1248
1249   /* Else will try to reuse lookahead token after shifting the error
1250      token.  */
1251
1252   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1253
1254   for (;;)
1255     {
1256       yyn = yypact[yystate];
1257       if (yyn != YYPACT_NINF)
1258         {
1259           yyn += YYTERROR;
1260           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1261             {
1262               yyn = yytable[yyn];
1263               if (0 < yyn)
1264                 break;
1265             }
1266         }
1267
1268       /* Pop the current state because it cannot handle the error token.  */
1269       if (yyssp == yyss)
1270         YYABORT;
1271
1272       YYDPRINTF ((stderr, "Error: popping "));
1273       YYDSYMPRINT ((stderr,
1274                     yystos[*yyssp], *yyvsp));
1275       YYDPRINTF ((stderr, "\n"));
1276
1277       yydestruct (yystos[yystate], *yyvsp);
1278       yyvsp--;
1279       yystate = *--yyssp;
1280
1281
1282 #if YYDEBUG
1283       if (yydebug)
1284         {
1285           short *yyssp1 = yyss - 1;
1286           YYFPRINTF (stderr, "Error: state stack now");
1287           while (yyssp1 != yyssp)
1288             YYFPRINTF (stderr, " %d", *++yyssp1);
1289           YYFPRINTF (stderr, "\n");
1290         }
1291 #endif
1292     }
1293
1294   if (yyn == YYFINAL)
1295     YYACCEPT;
1296
1297   YYDPRINTF ((stderr, "Shifting error token, "));
1298
1299   *++yyvsp = yylval;
1300
1301
1302   yystate = yyn;
1303   goto yynewstate;
1304
1305
1306 /*-------------------------------------.
1307 | yyacceptlab -- YYACCEPT comes here.  |
1308 `-------------------------------------*/
1309 yyacceptlab:
1310   yyresult = 0;
1311   goto yyreturn;
1312
1313 /*-----------------------------------.
1314 | yyabortlab -- YYABORT comes here.  |
1315 `-----------------------------------*/
1316 yyabortlab:
1317   yyresult = 1;
1318   goto yyreturn;
1319
1320 #ifndef yyoverflow
1321 /*----------------------------------------------.
1322 | yyoverflowlab -- parser overflow comes here.  |
1323 `----------------------------------------------*/
1324 yyoverflowlab:
1325   yyerror ("parser stack overflow");
1326   yyresult = 2;
1327   /* Fall through.  */
1328 #endif
1329
1330 yyreturn:
1331 #ifndef yyoverflow
1332   if (yyss != yyssa)
1333     YYSTACK_FREE (yyss);
1334 #endif
1335   return yyresult;
1336 }
1337
1338
1339 #line 124 "partn.y"
1340
1341
1342