s4:heimdal: regerenate files
[metze/samba/wip.git] / source4 / heimdal / lib / com_err / parse.c
1
2 /* A Bison parser, made by GNU Bison 2.4.1.  */
3
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
5    
6       Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7    Free Software Foundation, Inc.
8    
9    This program is free software: you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation, either version 3 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
21
22 /* As a special exception, you may create a larger work that contains
23    part or all of the Bison parser skeleton and distribute that work
24    under terms of your choice, so long as that work isn't itself a
25    parser generator using the skeleton or a modified version thereof
26    as a parser skeleton.  Alternatively, if you modify or redistribute
27    the parser skeleton itself, you may (at your option) remove this
28    special exception, which will cause the skeleton and the resulting
29    Bison output files to be licensed under the GNU General Public
30    License without this special exception.
31    
32    This special exception was added by the Free Software Foundation in
33    version 2.2 of Bison.  */
34
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36    simplifying the original so-called "semantic" parser.  */
37
38 /* All symbols defined below should begin with yy or YY, to avoid
39    infringing on user name space.  This should be done even for local
40    variables, as they might otherwise be expanded by user macros.
41    There are some unavoidable exceptions within include files to
42    define necessary library symbols; they are noted "INFRINGES ON
43    USER NAME SPACE" below.  */
44
45 /* Identify Bison output.  */
46 #define YYBISON 1
47
48 /* Bison version.  */
49 #define YYBISON_VERSION "2.4.1"
50
51 /* Skeleton name.  */
52 #define YYSKELETON_NAME "yacc.c"
53
54 /* Pure parsers.  */
55 #define YYPURE 0
56
57 /* Push parsers.  */
58 #define YYPUSH 0
59
60 /* Pull parsers.  */
61 #define YYPULL 1
62
63 /* Using locations.  */
64 #define YYLSP_NEEDED 0
65
66
67
68 /* Copy the first part of user declarations.  */
69
70 /* Line 189 of yacc.c  */
71 #line 1 "heimdal/lib/com_err/parse.y"
72
73 /*
74  * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
75  * (Royal Institute of Technology, Stockholm, Sweden).
76  * All rights reserved.
77  *
78  * Redistribution and use in source and binary forms, with or without
79  * modification, are permitted provided that the following conditions
80  * are met:
81  *
82  * 1. Redistributions of source code must retain the above copyright
83  *    notice, this list of conditions and the following disclaimer.
84  *
85  * 2. Redistributions in binary form must reproduce the above copyright
86  *    notice, this list of conditions and the following disclaimer in the
87  *    documentation and/or other materials provided with the distribution.
88  *
89  * 3. Neither the name of the Institute nor the names of its contributors
90  *    may be used to endorse or promote products derived from this software
91  *    without specific prior written permission.
92  *
93  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
94  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
95  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
96  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
97  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
98  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
99  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
100  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
101  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
102  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
103  * SUCH DAMAGE.
104  */
105
106 #include "compile_et.h"
107 #include "lex.h"
108
109 void yyerror (char *s);
110 static long name2number(const char *str);
111
112 extern char *yytext;
113
114 /* This is for bison */
115
116 #if !defined(alloca) && !defined(HAVE_ALLOCA)
117 #define alloca(x) malloc(x)
118 #endif
119
120
121
122 /* Line 189 of yacc.c  */
123 #line 124 "heimdal/lib/com_err/parse.y"
124
125 /* Enabling traces.  */
126 #ifndef YYDEBUG
127 # define YYDEBUG 0
128 #endif
129
130 /* Enabling verbose error messages.  */
131 #ifdef YYERROR_VERBOSE
132 # undef YYERROR_VERBOSE
133 # define YYERROR_VERBOSE 1
134 #else
135 # define YYERROR_VERBOSE 0
136 #endif
137
138 /* Enabling the token table.  */
139 #ifndef YYTOKEN_TABLE
140 # define YYTOKEN_TABLE 0
141 #endif
142
143
144 /* Tokens.  */
145 #ifndef YYTOKENTYPE
146 # define YYTOKENTYPE
147    /* Put the tokens into the symbol table, so that GDB and other debuggers
148       know about them.  */
149    enum yytokentype {
150      ET = 258,
151      INDEX = 259,
152      PREFIX = 260,
153      EC = 261,
154      ID = 262,
155      END = 263,
156      STRING = 264,
157      NUMBER = 265
158    };
159 #endif
160 /* Tokens.  */
161 #define ET 258
162 #define INDEX 259
163 #define PREFIX 260
164 #define EC 261
165 #define ID 262
166 #define END 263
167 #define STRING 264
168 #define NUMBER 265
169
170
171
172
173 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
174 typedef union YYSTYPE
175 {
176
177 /* Line 214 of yacc.c  */
178 #line 51 "heimdal/lib/com_err/parse.y"
179
180   char *string;
181   int number;
182
183
184
185 /* Line 214 of yacc.c  */
186 #line 187 "heimdal/lib/com_err/parse.y"
187 } YYSTYPE;
188 # define YYSTYPE_IS_TRIVIAL 1
189 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
190 # define YYSTYPE_IS_DECLARED 1
191 #endif
192
193
194 /* Copy the second part of user declarations.  */
195
196
197 /* Line 264 of yacc.c  */
198 #line 199 "heimdal/lib/com_err/parse.y"
199
200 #ifdef short
201 # undef short
202 #endif
203
204 #ifdef YYTYPE_UINT8
205 typedef YYTYPE_UINT8 yytype_uint8;
206 #else
207 typedef unsigned char yytype_uint8;
208 #endif
209
210 #ifdef YYTYPE_INT8
211 typedef YYTYPE_INT8 yytype_int8;
212 #elif (defined __STDC__ || defined __C99__FUNC__ \
213      || defined __cplusplus || defined _MSC_VER)
214 typedef signed char yytype_int8;
215 #else
216 typedef short int yytype_int8;
217 #endif
218
219 #ifdef YYTYPE_UINT16
220 typedef YYTYPE_UINT16 yytype_uint16;
221 #else
222 typedef unsigned short int yytype_uint16;
223 #endif
224
225 #ifdef YYTYPE_INT16
226 typedef YYTYPE_INT16 yytype_int16;
227 #else
228 typedef short int yytype_int16;
229 #endif
230
231 #ifndef YYSIZE_T
232 # ifdef __SIZE_TYPE__
233 #  define YYSIZE_T __SIZE_TYPE__
234 # elif defined size_t
235 #  define YYSIZE_T size_t
236 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
237      || defined __cplusplus || defined _MSC_VER)
238 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
239 #  define YYSIZE_T size_t
240 # else
241 #  define YYSIZE_T unsigned int
242 # endif
243 #endif
244
245 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
246
247 #ifndef YY_
248 # if YYENABLE_NLS
249 #  if ENABLE_NLS
250 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
251 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
252 #  endif
253 # endif
254 # ifndef YY_
255 #  define YY_(msgid) msgid
256 # endif
257 #endif
258
259 /* Suppress unused-variable warnings by "using" E.  */
260 #if ! defined lint || defined __GNUC__
261 # define YYUSE(e) ((void) (e))
262 #else
263 # define YYUSE(e) /* empty */
264 #endif
265
266 /* Identity function, used to suppress warnings about constant conditions.  */
267 #ifndef lint
268 # define YYID(n) (n)
269 #else
270 #if (defined __STDC__ || defined __C99__FUNC__ \
271      || defined __cplusplus || defined _MSC_VER)
272 static int
273 YYID (int yyi)
274 #else
275 static int
276 YYID (yyi)
277     int yyi;
278 #endif
279 {
280   return yyi;
281 }
282 #endif
283
284 #if ! defined yyoverflow || YYERROR_VERBOSE
285
286 /* The parser invokes alloca or malloc; define the necessary symbols.  */
287
288 # ifdef YYSTACK_USE_ALLOCA
289 #  if YYSTACK_USE_ALLOCA
290 #   ifdef __GNUC__
291 #    define YYSTACK_ALLOC __builtin_alloca
292 #   elif defined __BUILTIN_VA_ARG_INCR
293 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
294 #   elif defined _AIX
295 #    define YYSTACK_ALLOC __alloca
296 #   elif defined _MSC_VER
297 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
298 #    define alloca _alloca
299 #   else
300 #    define YYSTACK_ALLOC alloca
301 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
302      || defined __cplusplus || defined _MSC_VER)
303 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
304 #     ifndef _STDLIB_H
305 #      define _STDLIB_H 1
306 #     endif
307 #    endif
308 #   endif
309 #  endif
310 # endif
311
312 # ifdef YYSTACK_ALLOC
313    /* Pacify GCC's `empty if-body' warning.  */
314 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
315 #  ifndef YYSTACK_ALLOC_MAXIMUM
316     /* The OS might guarantee only one guard page at the bottom of the stack,
317        and a page size can be as small as 4096 bytes.  So we cannot safely
318        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
319        to allow for a few compiler-allocated temporary stack slots.  */
320 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
321 #  endif
322 # else
323 #  define YYSTACK_ALLOC YYMALLOC
324 #  define YYSTACK_FREE YYFREE
325 #  ifndef YYSTACK_ALLOC_MAXIMUM
326 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
327 #  endif
328 #  if (defined __cplusplus && ! defined _STDLIB_H \
329        && ! ((defined YYMALLOC || defined malloc) \
330              && (defined YYFREE || defined free)))
331 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
332 #   ifndef _STDLIB_H
333 #    define _STDLIB_H 1
334 #   endif
335 #  endif
336 #  ifndef YYMALLOC
337 #   define YYMALLOC malloc
338 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
339      || defined __cplusplus || defined _MSC_VER)
340 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
341 #   endif
342 #  endif
343 #  ifndef YYFREE
344 #   define YYFREE free
345 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
346      || defined __cplusplus || defined _MSC_VER)
347 void free (void *); /* INFRINGES ON USER NAME SPACE */
348 #   endif
349 #  endif
350 # endif
351 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
352
353
354 #if (! defined yyoverflow \
355      && (! defined __cplusplus \
356          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
357
358 /* A type that is properly aligned for any stack member.  */
359 union yyalloc
360 {
361   yytype_int16 yyss_alloc;
362   YYSTYPE yyvs_alloc;
363 };
364
365 /* The size of the maximum gap between one aligned stack and the next.  */
366 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
367
368 /* The size of an array large to enough to hold all stacks, each with
369    N elements.  */
370 # define YYSTACK_BYTES(N) \
371      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
372       + YYSTACK_GAP_MAXIMUM)
373
374 /* Copy COUNT objects from FROM to TO.  The source and destination do
375    not overlap.  */
376 # ifndef YYCOPY
377 #  if defined __GNUC__ && 1 < __GNUC__
378 #   define YYCOPY(To, From, Count) \
379       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
380 #  else
381 #   define YYCOPY(To, From, Count)              \
382       do                                        \
383         {                                       \
384           YYSIZE_T yyi;                         \
385           for (yyi = 0; yyi < (Count); yyi++)   \
386             (To)[yyi] = (From)[yyi];            \
387         }                                       \
388       while (YYID (0))
389 #  endif
390 # endif
391
392 /* Relocate STACK from its old location to the new one.  The
393    local variables YYSIZE and YYSTACKSIZE give the old and new number of
394    elements in the stack, and YYPTR gives the new location of the
395    stack.  Advance YYPTR to a properly aligned location for the next
396    stack.  */
397 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
398     do                                                                  \
399       {                                                                 \
400         YYSIZE_T yynewbytes;                                            \
401         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
402         Stack = &yyptr->Stack_alloc;                                    \
403         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
404         yyptr += yynewbytes / sizeof (*yyptr);                          \
405       }                                                                 \
406     while (YYID (0))
407
408 #endif
409
410 /* YYFINAL -- State number of the termination state.  */
411 #define YYFINAL  9
412 /* YYLAST -- Last index in YYTABLE.  */
413 #define YYLAST   23
414
415 /* YYNTOKENS -- Number of terminals.  */
416 #define YYNTOKENS  12
417 /* YYNNTS -- Number of nonterminals.  */
418 #define YYNNTS  7
419 /* YYNRULES -- Number of rules.  */
420 #define YYNRULES  15
421 /* YYNRULES -- Number of states.  */
422 #define YYNSTATES  24
423
424 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
425 #define YYUNDEFTOK  2
426 #define YYMAXUTOK   265
427
428 #define YYTRANSLATE(YYX)                                                \
429   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
430
431 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
432 static const yytype_uint8 yytranslate[] =
433 {
434        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
435        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
436        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
437        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
438        2,     2,     2,     2,    11,     2,     2,     2,     2,     2,
439        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
440        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
441        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
442        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
443        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
444        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
445        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
446        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
447        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
448        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
449        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
450        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
451        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
452        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
453        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
454        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
455        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
456        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
457        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
458        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
459        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
460        5,     6,     7,     8,     9,    10
461 };
462
463 #if YYDEBUG
464 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
465    YYRHS.  */
466 static const yytype_uint8 yyprhs[] =
467 {
468        0,     0,     3,     4,     7,    10,    12,    15,    18,    22,
469       24,    27,    30,    33,    35,    40
470 };
471
472 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
473 static const yytype_int8 yyrhs[] =
474 {
475       13,     0,    -1,    -1,    14,    17,    -1,    15,    16,    -1,
476       16,    -1,     7,     9,    -1,     3,     9,    -1,     3,     9,
477        9,    -1,    18,    -1,    17,    18,    -1,     4,    10,    -1,
478        5,     9,    -1,     5,    -1,     6,     9,    11,     9,    -1,
479        8,    -1
480 };
481
482 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
483 static const yytype_uint8 yyrline[] =
484 {
485        0,    62,    62,    63,    66,    67,    70,    76,    82,    91,
486       92,    95,    99,   107,   114,   134
487 };
488 #endif
489
490 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
491 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
492    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
493 static const char *const yytname[] =
494 {
495   "$end", "error", "$undefined", "ET", "INDEX", "PREFIX", "EC", "ID",
496   "END", "STRING", "NUMBER", "','", "$accept", "file", "header", "id",
497   "et", "statements", "statement", 0
498 };
499 #endif
500
501 # ifdef YYPRINT
502 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
503    token YYLEX-NUM.  */
504 static const yytype_uint16 yytoknum[] =
505 {
506        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
507      265,    44
508 };
509 # endif
510
511 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
512 static const yytype_uint8 yyr1[] =
513 {
514        0,    12,    13,    13,    14,    14,    15,    16,    16,    17,
515       17,    18,    18,    18,    18,    18
516 };
517
518 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
519 static const yytype_uint8 yyr2[] =
520 {
521        0,     2,     0,     2,     2,     1,     2,     2,     3,     1,
522        2,     2,     2,     1,     4,     1
523 };
524
525 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
526    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
527    means the default is an error.  */
528 static const yytype_uint8 yydefact[] =
529 {
530        2,     0,     0,     0,     0,     0,     5,     7,     6,     1,
531        0,    13,     0,    15,     3,     9,     4,     8,    11,    12,
532        0,    10,     0,    14
533 };
534
535 /* YYDEFGOTO[NTERM-NUM].  */
536 static const yytype_int8 yydefgoto[] =
537 {
538       -1,     3,     4,     5,     6,    14,    15
539 };
540
541 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
542    STATE-NUM.  */
543 #define YYPACT_NINF -5
544 static const yytype_int8 yypact[] =
545 {
546        0,    -3,    -1,     5,    -4,     6,    -5,     1,    -5,    -5,
547        2,     4,     7,    -5,    -4,    -5,    -5,    -5,    -5,    -5,
548        3,    -5,     8,    -5
549 };
550
551 /* YYPGOTO[NTERM-NUM].  */
552 static const yytype_int8 yypgoto[] =
553 {
554       -5,    -5,    -5,    -5,    10,    -5,     9
555 };
556
557 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
558    positive, shift that token.  If negative, reduce the rule which
559    number is the opposite.  If zero, do what YYDEFACT says.
560    If YYTABLE_NINF, syntax error.  */
561 #define YYTABLE_NINF -1
562 static const yytype_uint8 yytable[] =
563 {
564       10,    11,    12,     1,    13,     9,     7,     2,     8,     1,
565       17,     0,    18,    19,    22,    16,    20,    23,     0,     0,
566        0,     0,     0,    21
567 };
568
569 static const yytype_int8 yycheck[] =
570 {
571        4,     5,     6,     3,     8,     0,     9,     7,     9,     3,
572        9,    -1,    10,     9,    11,     5,     9,     9,    -1,    -1,
573       -1,    -1,    -1,    14
574 };
575
576 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
577    symbol of state STATE-NUM.  */
578 static const yytype_uint8 yystos[] =
579 {
580        0,     3,     7,    13,    14,    15,    16,     9,     9,     0,
581        4,     5,     6,     8,    17,    18,    16,     9,    10,     9,
582        9,    18,    11,     9
583 };
584
585 #define yyerrok         (yyerrstatus = 0)
586 #define yyclearin       (yychar = YYEMPTY)
587 #define YYEMPTY         (-2)
588 #define YYEOF           0
589
590 #define YYACCEPT        goto yyacceptlab
591 #define YYABORT         goto yyabortlab
592 #define YYERROR         goto yyerrorlab
593
594
595 /* Like YYERROR except do call yyerror.  This remains here temporarily
596    to ease the transition to the new meaning of YYERROR, for GCC.
597    Once GCC version 2 has supplanted version 1, this can go.  */
598
599 #define YYFAIL          goto yyerrlab
600
601 #define YYRECOVERING()  (!!yyerrstatus)
602
603 #define YYBACKUP(Token, Value)                                  \
604 do                                                              \
605   if (yychar == YYEMPTY && yylen == 1)                          \
606     {                                                           \
607       yychar = (Token);                                         \
608       yylval = (Value);                                         \
609       yytoken = YYTRANSLATE (yychar);                           \
610       YYPOPSTACK (1);                                           \
611       goto yybackup;                                            \
612     }                                                           \
613   else                                                          \
614     {                                                           \
615       yyerror (YY_("syntax error: cannot back up")); \
616       YYERROR;                                                  \
617     }                                                           \
618 while (YYID (0))
619
620
621 #define YYTERROR        1
622 #define YYERRCODE       256
623
624
625 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
626    If N is 0, then set CURRENT to the empty location which ends
627    the previous symbol: RHS[0] (always defined).  */
628
629 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
630 #ifndef YYLLOC_DEFAULT
631 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
632     do                                                                  \
633       if (YYID (N))                                                    \
634         {                                                               \
635           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
636           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
637           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
638           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
639         }                                                               \
640       else                                                              \
641         {                                                               \
642           (Current).first_line   = (Current).last_line   =              \
643             YYRHSLOC (Rhs, 0).last_line;                                \
644           (Current).first_column = (Current).last_column =              \
645             YYRHSLOC (Rhs, 0).last_column;                              \
646         }                                                               \
647     while (YYID (0))
648 #endif
649
650
651 /* YY_LOCATION_PRINT -- Print the location on the stream.
652    This macro was not mandated originally: define only if we know
653    we won't break user code: when these are the locations we know.  */
654
655 #ifndef YY_LOCATION_PRINT
656 # if YYLTYPE_IS_TRIVIAL
657 #  define YY_LOCATION_PRINT(File, Loc)                  \
658      fprintf (File, "%d.%d-%d.%d",                      \
659               (Loc).first_line, (Loc).first_column,     \
660               (Loc).last_line,  (Loc).last_column)
661 # else
662 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
663 # endif
664 #endif
665
666
667 /* YYLEX -- calling `yylex' with the right arguments.  */
668
669 #ifdef YYLEX_PARAM
670 # define YYLEX yylex (YYLEX_PARAM)
671 #else
672 # define YYLEX yylex ()
673 #endif
674
675 /* Enable debugging if requested.  */
676 #if YYDEBUG
677
678 # ifndef YYFPRINTF
679 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
680 #  define YYFPRINTF fprintf
681 # endif
682
683 # define YYDPRINTF(Args)                        \
684 do {                                            \
685   if (yydebug)                                  \
686     YYFPRINTF Args;                             \
687 } while (YYID (0))
688
689 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
690 do {                                                                      \
691   if (yydebug)                                                            \
692     {                                                                     \
693       YYFPRINTF (stderr, "%s ", Title);                                   \
694       yy_symbol_print (stderr,                                            \
695                   Type, Value); \
696       YYFPRINTF (stderr, "\n");                                           \
697     }                                                                     \
698 } while (YYID (0))
699
700
701 /*--------------------------------.
702 | Print this symbol on YYOUTPUT.  |
703 `--------------------------------*/
704
705 /*ARGSUSED*/
706 #if (defined __STDC__ || defined __C99__FUNC__ \
707      || defined __cplusplus || defined _MSC_VER)
708 static void
709 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
710 #else
711 static void
712 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
713     FILE *yyoutput;
714     int yytype;
715     YYSTYPE const * const yyvaluep;
716 #endif
717 {
718   if (!yyvaluep)
719     return;
720 # ifdef YYPRINT
721   if (yytype < YYNTOKENS)
722     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
723 # else
724   YYUSE (yyoutput);
725 # endif
726   switch (yytype)
727     {
728       default:
729         break;
730     }
731 }
732
733
734 /*--------------------------------.
735 | Print this symbol on YYOUTPUT.  |
736 `--------------------------------*/
737
738 #if (defined __STDC__ || defined __C99__FUNC__ \
739      || defined __cplusplus || defined _MSC_VER)
740 static void
741 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
742 #else
743 static void
744 yy_symbol_print (yyoutput, yytype, yyvaluep)
745     FILE *yyoutput;
746     int yytype;
747     YYSTYPE const * const yyvaluep;
748 #endif
749 {
750   if (yytype < YYNTOKENS)
751     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
752   else
753     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
754
755   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
756   YYFPRINTF (yyoutput, ")");
757 }
758
759 /*------------------------------------------------------------------.
760 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
761 | TOP (included).                                                   |
762 `------------------------------------------------------------------*/
763
764 #if (defined __STDC__ || defined __C99__FUNC__ \
765      || defined __cplusplus || defined _MSC_VER)
766 static void
767 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
768 #else
769 static void
770 yy_stack_print (yybottom, yytop)
771     yytype_int16 *yybottom;
772     yytype_int16 *yytop;
773 #endif
774 {
775   YYFPRINTF (stderr, "Stack now");
776   for (; yybottom <= yytop; yybottom++)
777     {
778       int yybot = *yybottom;
779       YYFPRINTF (stderr, " %d", yybot);
780     }
781   YYFPRINTF (stderr, "\n");
782 }
783
784 # define YY_STACK_PRINT(Bottom, Top)                            \
785 do {                                                            \
786   if (yydebug)                                                  \
787     yy_stack_print ((Bottom), (Top));                           \
788 } while (YYID (0))
789
790
791 /*------------------------------------------------.
792 | Report that the YYRULE is going to be reduced.  |
793 `------------------------------------------------*/
794
795 #if (defined __STDC__ || defined __C99__FUNC__ \
796      || defined __cplusplus || defined _MSC_VER)
797 static void
798 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
799 #else
800 static void
801 yy_reduce_print (yyvsp, yyrule)
802     YYSTYPE *yyvsp;
803     int yyrule;
804 #endif
805 {
806   int yynrhs = yyr2[yyrule];
807   int yyi;
808   unsigned long int yylno = yyrline[yyrule];
809   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
810              yyrule - 1, yylno);
811   /* The symbols being reduced.  */
812   for (yyi = 0; yyi < yynrhs; yyi++)
813     {
814       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
815       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
816                        &(yyvsp[(yyi + 1) - (yynrhs)])
817                                        );
818       YYFPRINTF (stderr, "\n");
819     }
820 }
821
822 # define YY_REDUCE_PRINT(Rule)          \
823 do {                                    \
824   if (yydebug)                          \
825     yy_reduce_print (yyvsp, Rule); \
826 } while (YYID (0))
827
828 /* Nonzero means print parse trace.  It is left uninitialized so that
829    multiple parsers can coexist.  */
830 int yydebug;
831 #else /* !YYDEBUG */
832 # define YYDPRINTF(Args)
833 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
834 # define YY_STACK_PRINT(Bottom, Top)
835 # define YY_REDUCE_PRINT(Rule)
836 #endif /* !YYDEBUG */
837
838
839 /* YYINITDEPTH -- initial size of the parser's stacks.  */
840 #ifndef YYINITDEPTH
841 # define YYINITDEPTH 200
842 #endif
843
844 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
845    if the built-in stack extension method is used).
846
847    Do not make this value too large; the results are undefined if
848    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
849    evaluated with infinite-precision integer arithmetic.  */
850
851 #ifndef YYMAXDEPTH
852 # define YYMAXDEPTH 10000
853 #endif
854
855 \f
856
857 #if YYERROR_VERBOSE
858
859 # ifndef yystrlen
860 #  if defined __GLIBC__ && defined _STRING_H
861 #   define yystrlen strlen
862 #  else
863 /* Return the length of YYSTR.  */
864 #if (defined __STDC__ || defined __C99__FUNC__ \
865      || defined __cplusplus || defined _MSC_VER)
866 static YYSIZE_T
867 yystrlen (const char *yystr)
868 #else
869 static YYSIZE_T
870 yystrlen (yystr)
871     const char *yystr;
872 #endif
873 {
874   YYSIZE_T yylen;
875   for (yylen = 0; yystr[yylen]; yylen++)
876     continue;
877   return yylen;
878 }
879 #  endif
880 # endif
881
882 # ifndef yystpcpy
883 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
884 #   define yystpcpy stpcpy
885 #  else
886 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
887    YYDEST.  */
888 #if (defined __STDC__ || defined __C99__FUNC__ \
889      || defined __cplusplus || defined _MSC_VER)
890 static char *
891 yystpcpy (char *yydest, const char *yysrc)
892 #else
893 static char *
894 yystpcpy (yydest, yysrc)
895     char *yydest;
896     const char *yysrc;
897 #endif
898 {
899   char *yyd = yydest;
900   const char *yys = yysrc;
901
902   while ((*yyd++ = *yys++) != '\0')
903     continue;
904
905   return yyd - 1;
906 }
907 #  endif
908 # endif
909
910 # ifndef yytnamerr
911 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
912    quotes and backslashes, so that it's suitable for yyerror.  The
913    heuristic is that double-quoting is unnecessary unless the string
914    contains an apostrophe, a comma, or backslash (other than
915    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
916    null, do not copy; instead, return the length of what the result
917    would have been.  */
918 static YYSIZE_T
919 yytnamerr (char *yyres, const char *yystr)
920 {
921   if (*yystr == '"')
922     {
923       YYSIZE_T yyn = 0;
924       char const *yyp = yystr;
925
926       for (;;)
927         switch (*++yyp)
928           {
929           case '\'':
930           case ',':
931             goto do_not_strip_quotes;
932
933           case '\\':
934             if (*++yyp != '\\')
935               goto do_not_strip_quotes;
936             /* Fall through.  */
937           default:
938             if (yyres)
939               yyres[yyn] = *yyp;
940             yyn++;
941             break;
942
943           case '"':
944             if (yyres)
945               yyres[yyn] = '\0';
946             return yyn;
947           }
948     do_not_strip_quotes: ;
949     }
950
951   if (! yyres)
952     return yystrlen (yystr);
953
954   return yystpcpy (yyres, yystr) - yyres;
955 }
956 # endif
957
958 /* Copy into YYRESULT an error message about the unexpected token
959    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
960    including the terminating null byte.  If YYRESULT is null, do not
961    copy anything; just return the number of bytes that would be
962    copied.  As a special case, return 0 if an ordinary "syntax error"
963    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
964    size calculation.  */
965 static YYSIZE_T
966 yysyntax_error (char *yyresult, int yystate, int yychar)
967 {
968   int yyn = yypact[yystate];
969
970   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
971     return 0;
972   else
973     {
974       int yytype = YYTRANSLATE (yychar);
975       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
976       YYSIZE_T yysize = yysize0;
977       YYSIZE_T yysize1;
978       int yysize_overflow = 0;
979       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
980       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
981       int yyx;
982
983 # if 0
984       /* This is so xgettext sees the translatable formats that are
985          constructed on the fly.  */
986       YY_("syntax error, unexpected %s");
987       YY_("syntax error, unexpected %s, expecting %s");
988       YY_("syntax error, unexpected %s, expecting %s or %s");
989       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
990       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
991 # endif
992       char *yyfmt;
993       char const *yyf;
994       static char const yyunexpected[] = "syntax error, unexpected %s";
995       static char const yyexpecting[] = ", expecting %s";
996       static char const yyor[] = " or %s";
997       char yyformat[sizeof yyunexpected
998                     + sizeof yyexpecting - 1
999                     + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1000                        * (sizeof yyor - 1))];
1001       char const *yyprefix = yyexpecting;
1002
1003       /* Start YYX at -YYN if negative to avoid negative indexes in
1004          YYCHECK.  */
1005       int yyxbegin = yyn < 0 ? -yyn : 0;
1006
1007       /* Stay within bounds of both yycheck and yytname.  */
1008       int yychecklim = YYLAST - yyn + 1;
1009       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1010       int yycount = 1;
1011
1012       yyarg[0] = yytname[yytype];
1013       yyfmt = yystpcpy (yyformat, yyunexpected);
1014
1015       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1016         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1017           {
1018             if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1019               {
1020                 yycount = 1;
1021                 yysize = yysize0;
1022                 yyformat[sizeof yyunexpected - 1] = '\0';
1023                 break;
1024               }
1025             yyarg[yycount++] = yytname[yyx];
1026             yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1027             yysize_overflow |= (yysize1 < yysize);
1028             yysize = yysize1;
1029             yyfmt = yystpcpy (yyfmt, yyprefix);
1030             yyprefix = yyor;
1031           }
1032
1033       yyf = YY_(yyformat);
1034       yysize1 = yysize + yystrlen (yyf);
1035       yysize_overflow |= (yysize1 < yysize);
1036       yysize = yysize1;
1037
1038       if (yysize_overflow)
1039         return YYSIZE_MAXIMUM;
1040
1041       if (yyresult)
1042         {
1043           /* Avoid sprintf, as that infringes on the user's name space.
1044              Don't have undefined behavior even if the translation
1045              produced a string with the wrong number of "%s"s.  */
1046           char *yyp = yyresult;
1047           int yyi = 0;
1048           while ((*yyp = *yyf) != '\0')
1049             {
1050               if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1051                 {
1052                   yyp += yytnamerr (yyp, yyarg[yyi++]);
1053                   yyf += 2;
1054                 }
1055               else
1056                 {
1057                   yyp++;
1058                   yyf++;
1059                 }
1060             }
1061         }
1062       return yysize;
1063     }
1064 }
1065 #endif /* YYERROR_VERBOSE */
1066 \f
1067
1068 /*-----------------------------------------------.
1069 | Release the memory associated to this symbol.  |
1070 `-----------------------------------------------*/
1071
1072 /*ARGSUSED*/
1073 #if (defined __STDC__ || defined __C99__FUNC__ \
1074      || defined __cplusplus || defined _MSC_VER)
1075 static void
1076 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1077 #else
1078 static void
1079 yydestruct (yymsg, yytype, yyvaluep)
1080     const char *yymsg;
1081     int yytype;
1082     YYSTYPE *yyvaluep;
1083 #endif
1084 {
1085   YYUSE (yyvaluep);
1086
1087   if (!yymsg)
1088     yymsg = "Deleting";
1089   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1090
1091   switch (yytype)
1092     {
1093
1094       default:
1095         break;
1096     }
1097 }
1098
1099 /* Prevent warnings from -Wmissing-prototypes.  */
1100 #ifdef YYPARSE_PARAM
1101 #if defined __STDC__ || defined __cplusplus
1102 int yyparse (void *YYPARSE_PARAM);
1103 #else
1104 int yyparse ();
1105 #endif
1106 #else /* ! YYPARSE_PARAM */
1107 #if defined __STDC__ || defined __cplusplus
1108 int yyparse (void);
1109 #else
1110 int yyparse ();
1111 #endif
1112 #endif /* ! YYPARSE_PARAM */
1113
1114
1115 /* The lookahead symbol.  */
1116 int yychar;
1117
1118 /* The semantic value of the lookahead symbol.  */
1119 YYSTYPE yylval;
1120
1121 /* Number of syntax errors so far.  */
1122 int yynerrs;
1123
1124
1125
1126 /*-------------------------.
1127 | yyparse or yypush_parse.  |
1128 `-------------------------*/
1129
1130 #ifdef YYPARSE_PARAM
1131 #if (defined __STDC__ || defined __C99__FUNC__ \
1132      || defined __cplusplus || defined _MSC_VER)
1133 int
1134 yyparse (void *YYPARSE_PARAM)
1135 #else
1136 int
1137 yyparse (YYPARSE_PARAM)
1138     void *YYPARSE_PARAM;
1139 #endif
1140 #else /* ! YYPARSE_PARAM */
1141 #if (defined __STDC__ || defined __C99__FUNC__ \
1142      || defined __cplusplus || defined _MSC_VER)
1143 int
1144 yyparse (void)
1145 #else
1146 int
1147 yyparse ()
1148
1149 #endif
1150 #endif
1151 {
1152
1153
1154     int yystate;
1155     /* Number of tokens to shift before error messages enabled.  */
1156     int yyerrstatus;
1157
1158     /* The stacks and their tools:
1159        `yyss': related to states.
1160        `yyvs': related to semantic values.
1161
1162        Refer to the stacks thru separate pointers, to allow yyoverflow
1163        to reallocate them elsewhere.  */
1164
1165     /* The state stack.  */
1166     yytype_int16 yyssa[YYINITDEPTH];
1167     yytype_int16 *yyss;
1168     yytype_int16 *yyssp;
1169
1170     /* The semantic value stack.  */
1171     YYSTYPE yyvsa[YYINITDEPTH];
1172     YYSTYPE *yyvs;
1173     YYSTYPE *yyvsp;
1174
1175     YYSIZE_T yystacksize;
1176
1177   int yyn;
1178   int yyresult;
1179   /* Lookahead token as an internal (translated) token number.  */
1180   int yytoken;
1181   /* The variables used to return semantic value and location from the
1182      action routines.  */
1183   YYSTYPE yyval;
1184
1185 #if YYERROR_VERBOSE
1186   /* Buffer for error messages, and its allocated size.  */
1187   char yymsgbuf[128];
1188   char *yymsg = yymsgbuf;
1189   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1190 #endif
1191
1192 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1193
1194   /* The number of symbols on the RHS of the reduced rule.
1195      Keep to zero when no symbol should be popped.  */
1196   int yylen = 0;
1197
1198   yytoken = 0;
1199   yyss = yyssa;
1200   yyvs = yyvsa;
1201   yystacksize = YYINITDEPTH;
1202
1203   YYDPRINTF ((stderr, "Starting parse\n"));
1204
1205   yystate = 0;
1206   yyerrstatus = 0;
1207   yynerrs = 0;
1208   yychar = YYEMPTY; /* Cause a token to be read.  */
1209
1210   /* Initialize stack pointers.
1211      Waste one element of value and location stack
1212      so that they stay on the same level as the state stack.
1213      The wasted elements are never initialized.  */
1214   yyssp = yyss;
1215   yyvsp = yyvs;
1216
1217   goto yysetstate;
1218
1219 /*------------------------------------------------------------.
1220 | yynewstate -- Push a new state, which is found in yystate.  |
1221 `------------------------------------------------------------*/
1222  yynewstate:
1223   /* In all cases, when you get here, the value and location stacks
1224      have just been pushed.  So pushing a state here evens the stacks.  */
1225   yyssp++;
1226
1227  yysetstate:
1228   *yyssp = yystate;
1229
1230   if (yyss + yystacksize - 1 <= yyssp)
1231     {
1232       /* Get the current used size of the three stacks, in elements.  */
1233       YYSIZE_T yysize = yyssp - yyss + 1;
1234
1235 #ifdef yyoverflow
1236       {
1237         /* Give user a chance to reallocate the stack.  Use copies of
1238            these so that the &'s don't force the real ones into
1239            memory.  */
1240         YYSTYPE *yyvs1 = yyvs;
1241         yytype_int16 *yyss1 = yyss;
1242
1243         /* Each stack pointer address is followed by the size of the
1244            data in use in that stack, in bytes.  This used to be a
1245            conditional around just the two extra args, but that might
1246            be undefined if yyoverflow is a macro.  */
1247         yyoverflow (YY_("memory exhausted"),
1248                     &yyss1, yysize * sizeof (*yyssp),
1249                     &yyvs1, yysize * sizeof (*yyvsp),
1250                     &yystacksize);
1251
1252         yyss = yyss1;
1253         yyvs = yyvs1;
1254       }
1255 #else /* no yyoverflow */
1256 # ifndef YYSTACK_RELOCATE
1257       goto yyexhaustedlab;
1258 # else
1259       /* Extend the stack our own way.  */
1260       if (YYMAXDEPTH <= yystacksize)
1261         goto yyexhaustedlab;
1262       yystacksize *= 2;
1263       if (YYMAXDEPTH < yystacksize)
1264         yystacksize = YYMAXDEPTH;
1265
1266       {
1267         yytype_int16 *yyss1 = yyss;
1268         union yyalloc *yyptr =
1269           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1270         if (! yyptr)
1271           goto yyexhaustedlab;
1272         YYSTACK_RELOCATE (yyss_alloc, yyss);
1273         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1274 #  undef YYSTACK_RELOCATE
1275         if (yyss1 != yyssa)
1276           YYSTACK_FREE (yyss1);
1277       }
1278 # endif
1279 #endif /* no yyoverflow */
1280
1281       yyssp = yyss + yysize - 1;
1282       yyvsp = yyvs + yysize - 1;
1283
1284       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1285                   (unsigned long int) yystacksize));
1286
1287       if (yyss + yystacksize - 1 <= yyssp)
1288         YYABORT;
1289     }
1290
1291   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1292
1293   if (yystate == YYFINAL)
1294     YYACCEPT;
1295
1296   goto yybackup;
1297
1298 /*-----------.
1299 | yybackup.  |
1300 `-----------*/
1301 yybackup:
1302
1303   /* Do appropriate processing given the current state.  Read a
1304      lookahead token if we need one and don't already have one.  */
1305
1306   /* First try to decide what to do without reference to lookahead token.  */
1307   yyn = yypact[yystate];
1308   if (yyn == YYPACT_NINF)
1309     goto yydefault;
1310
1311   /* Not known => get a lookahead token if don't already have one.  */
1312
1313   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1314   if (yychar == YYEMPTY)
1315     {
1316       YYDPRINTF ((stderr, "Reading a token: "));
1317       yychar = YYLEX;
1318     }
1319
1320   if (yychar <= YYEOF)
1321     {
1322       yychar = yytoken = YYEOF;
1323       YYDPRINTF ((stderr, "Now at end of input.\n"));
1324     }
1325   else
1326     {
1327       yytoken = YYTRANSLATE (yychar);
1328       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1329     }
1330
1331   /* If the proper action on seeing token YYTOKEN is to reduce or to
1332      detect an error, take that action.  */
1333   yyn += yytoken;
1334   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1335     goto yydefault;
1336   yyn = yytable[yyn];
1337   if (yyn <= 0)
1338     {
1339       if (yyn == 0 || yyn == YYTABLE_NINF)
1340         goto yyerrlab;
1341       yyn = -yyn;
1342       goto yyreduce;
1343     }
1344
1345   /* Count tokens shifted since error; after three, turn off error
1346      status.  */
1347   if (yyerrstatus)
1348     yyerrstatus--;
1349
1350   /* Shift the lookahead token.  */
1351   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1352
1353   /* Discard the shifted token.  */
1354   yychar = YYEMPTY;
1355
1356   yystate = yyn;
1357   *++yyvsp = yylval;
1358
1359   goto yynewstate;
1360
1361
1362 /*-----------------------------------------------------------.
1363 | yydefault -- do the default action for the current state.  |
1364 `-----------------------------------------------------------*/
1365 yydefault:
1366   yyn = yydefact[yystate];
1367   if (yyn == 0)
1368     goto yyerrlab;
1369   goto yyreduce;
1370
1371
1372 /*-----------------------------.
1373 | yyreduce -- Do a reduction.  |
1374 `-----------------------------*/
1375 yyreduce:
1376   /* yyn is the number of a rule to reduce with.  */
1377   yylen = yyr2[yyn];
1378
1379   /* If YYLEN is nonzero, implement the default value of the action:
1380      `$$ = $1'.
1381
1382      Otherwise, the following line sets YYVAL to garbage.
1383      This behavior is undocumented and Bison
1384      users should not rely upon it.  Assigning to YYVAL
1385      unconditionally makes the parser a bit smaller, and it avoids a
1386      GCC warning that YYVAL may be used uninitialized.  */
1387   yyval = yyvsp[1-yylen];
1388
1389
1390   YY_REDUCE_PRINT (yyn);
1391   switch (yyn)
1392     {
1393         case 6:
1394
1395 /* Line 1455 of yacc.c  */
1396 #line 71 "heimdal/lib/com_err/parse.y"
1397     {
1398                     id_str = (yyvsp[(2) - (2)].string);
1399                 }
1400     break;
1401
1402   case 7:
1403
1404 /* Line 1455 of yacc.c  */
1405 #line 77 "heimdal/lib/com_err/parse.y"
1406     {
1407                     base_id = name2number((yyvsp[(2) - (2)].string));
1408                     strlcpy(name, (yyvsp[(2) - (2)].string), sizeof(name));
1409                     free((yyvsp[(2) - (2)].string));
1410                 }
1411     break;
1412
1413   case 8:
1414
1415 /* Line 1455 of yacc.c  */
1416 #line 83 "heimdal/lib/com_err/parse.y"
1417     {
1418                     base_id = name2number((yyvsp[(2) - (3)].string));
1419                     strlcpy(name, (yyvsp[(3) - (3)].string), sizeof(name));
1420                     free((yyvsp[(2) - (3)].string));
1421                     free((yyvsp[(3) - (3)].string));
1422                 }
1423     break;
1424
1425   case 11:
1426
1427 /* Line 1455 of yacc.c  */
1428 #line 96 "heimdal/lib/com_err/parse.y"
1429     {
1430                         number = (yyvsp[(2) - (2)].number);
1431                 }
1432     break;
1433
1434   case 12:
1435
1436 /* Line 1455 of yacc.c  */
1437 #line 100 "heimdal/lib/com_err/parse.y"
1438     {
1439                     free(prefix);
1440                     asprintf (&prefix, "%s_", (yyvsp[(2) - (2)].string));
1441                     if (prefix == NULL)
1442                         errx(1, "malloc");
1443                     free((yyvsp[(2) - (2)].string));
1444                 }
1445     break;
1446
1447   case 13:
1448
1449 /* Line 1455 of yacc.c  */
1450 #line 108 "heimdal/lib/com_err/parse.y"
1451     {
1452                     prefix = realloc(prefix, 1);
1453                     if (prefix == NULL)
1454                         errx(1, "malloc");
1455                     *prefix = '\0';
1456                 }
1457     break;
1458
1459   case 14:
1460
1461 /* Line 1455 of yacc.c  */
1462 #line 115 "heimdal/lib/com_err/parse.y"
1463     {
1464                     struct error_code *ec = malloc(sizeof(*ec));
1465                 
1466                     if (ec == NULL)
1467                         errx(1, "malloc");
1468
1469                     ec->next = NULL;
1470                     ec->number = number;
1471                     if(prefix && *prefix != '\0') {
1472                         asprintf (&ec->name, "%s%s", prefix, (yyvsp[(2) - (4)].string));
1473                         if (ec->name == NULL)
1474                             errx(1, "malloc");
1475                         free((yyvsp[(2) - (4)].string));
1476                     } else
1477                         ec->name = (yyvsp[(2) - (4)].string);
1478                     ec->string = (yyvsp[(4) - (4)].string);
1479                     APPEND(codes, ec);
1480                     number++;
1481                 }
1482     break;
1483
1484   case 15:
1485
1486 /* Line 1455 of yacc.c  */
1487 #line 135 "heimdal/lib/com_err/parse.y"
1488     {
1489                         YYACCEPT;
1490                 }
1491     break;
1492
1493
1494
1495 /* Line 1455 of yacc.c  */
1496 #line 1497 "heimdal/lib/com_err/parse.y"
1497       default: break;
1498     }
1499   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1500
1501   YYPOPSTACK (yylen);
1502   yylen = 0;
1503   YY_STACK_PRINT (yyss, yyssp);
1504
1505   *++yyvsp = yyval;
1506
1507   /* Now `shift' the result of the reduction.  Determine what state
1508      that goes to, based on the state we popped back to and the rule
1509      number reduced by.  */
1510
1511   yyn = yyr1[yyn];
1512
1513   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1514   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1515     yystate = yytable[yystate];
1516   else
1517     yystate = yydefgoto[yyn - YYNTOKENS];
1518
1519   goto yynewstate;
1520
1521
1522 /*------------------------------------.
1523 | yyerrlab -- here on detecting error |
1524 `------------------------------------*/
1525 yyerrlab:
1526   /* If not already recovering from an error, report this error.  */
1527   if (!yyerrstatus)
1528     {
1529       ++yynerrs;
1530 #if ! YYERROR_VERBOSE
1531       yyerror (YY_("syntax error"));
1532 #else
1533       {
1534         YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1535         if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1536           {
1537             YYSIZE_T yyalloc = 2 * yysize;
1538             if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1539               yyalloc = YYSTACK_ALLOC_MAXIMUM;
1540             if (yymsg != yymsgbuf)
1541               YYSTACK_FREE (yymsg);
1542             yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1543             if (yymsg)
1544               yymsg_alloc = yyalloc;
1545             else
1546               {
1547                 yymsg = yymsgbuf;
1548                 yymsg_alloc = sizeof yymsgbuf;
1549               }
1550           }
1551
1552         if (0 < yysize && yysize <= yymsg_alloc)
1553           {
1554             (void) yysyntax_error (yymsg, yystate, yychar);
1555             yyerror (yymsg);
1556           }
1557         else
1558           {
1559             yyerror (YY_("syntax error"));
1560             if (yysize != 0)
1561               goto yyexhaustedlab;
1562           }
1563       }
1564 #endif
1565     }
1566
1567
1568
1569   if (yyerrstatus == 3)
1570     {
1571       /* If just tried and failed to reuse lookahead token after an
1572          error, discard it.  */
1573
1574       if (yychar <= YYEOF)
1575         {
1576           /* Return failure if at end of input.  */
1577           if (yychar == YYEOF)
1578             YYABORT;
1579         }
1580       else
1581         {
1582           yydestruct ("Error: discarding",
1583                       yytoken, &yylval);
1584           yychar = YYEMPTY;
1585         }
1586     }
1587
1588   /* Else will try to reuse lookahead token after shifting the error
1589      token.  */
1590   goto yyerrlab1;
1591
1592
1593 /*---------------------------------------------------.
1594 | yyerrorlab -- error raised explicitly by YYERROR.  |
1595 `---------------------------------------------------*/
1596 yyerrorlab:
1597
1598   /* Pacify compilers like GCC when the user code never invokes
1599      YYERROR and the label yyerrorlab therefore never appears in user
1600      code.  */
1601   if (/*CONSTCOND*/ 0)
1602      goto yyerrorlab;
1603
1604   /* Do not reclaim the symbols of the rule which action triggered
1605      this YYERROR.  */
1606   YYPOPSTACK (yylen);
1607   yylen = 0;
1608   YY_STACK_PRINT (yyss, yyssp);
1609   yystate = *yyssp;
1610   goto yyerrlab1;
1611
1612
1613 /*-------------------------------------------------------------.
1614 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
1615 `-------------------------------------------------------------*/
1616 yyerrlab1:
1617   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1618
1619   for (;;)
1620     {
1621       yyn = yypact[yystate];
1622       if (yyn != YYPACT_NINF)
1623         {
1624           yyn += YYTERROR;
1625           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1626             {
1627               yyn = yytable[yyn];
1628               if (0 < yyn)
1629                 break;
1630             }
1631         }
1632
1633       /* Pop the current state because it cannot handle the error token.  */
1634       if (yyssp == yyss)
1635         YYABORT;
1636
1637
1638       yydestruct ("Error: popping",
1639                   yystos[yystate], yyvsp);
1640       YYPOPSTACK (1);
1641       yystate = *yyssp;
1642       YY_STACK_PRINT (yyss, yyssp);
1643     }
1644
1645   *++yyvsp = yylval;
1646
1647
1648   /* Shift the error token.  */
1649   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1650
1651   yystate = yyn;
1652   goto yynewstate;
1653
1654
1655 /*-------------------------------------.
1656 | yyacceptlab -- YYACCEPT comes here.  |
1657 `-------------------------------------*/
1658 yyacceptlab:
1659   yyresult = 0;
1660   goto yyreturn;
1661
1662 /*-----------------------------------.
1663 | yyabortlab -- YYABORT comes here.  |
1664 `-----------------------------------*/
1665 yyabortlab:
1666   yyresult = 1;
1667   goto yyreturn;
1668
1669 #if !defined(yyoverflow) || YYERROR_VERBOSE
1670 /*-------------------------------------------------.
1671 | yyexhaustedlab -- memory exhaustion comes here.  |
1672 `-------------------------------------------------*/
1673 yyexhaustedlab:
1674   yyerror (YY_("memory exhausted"));
1675   yyresult = 2;
1676   /* Fall through.  */
1677 #endif
1678
1679 yyreturn:
1680   if (yychar != YYEMPTY)
1681      yydestruct ("Cleanup: discarding lookahead",
1682                  yytoken, &yylval);
1683   /* Do not reclaim the symbols of the rule which action triggered
1684      this YYABORT or YYACCEPT.  */
1685   YYPOPSTACK (yylen);
1686   YY_STACK_PRINT (yyss, yyssp);
1687   while (yyssp != yyss)
1688     {
1689       yydestruct ("Cleanup: popping",
1690                   yystos[*yyssp], yyvsp);
1691       YYPOPSTACK (1);
1692     }
1693 #ifndef yyoverflow
1694   if (yyss != yyssa)
1695     YYSTACK_FREE (yyss);
1696 #endif
1697 #if YYERROR_VERBOSE
1698   if (yymsg != yymsgbuf)
1699     YYSTACK_FREE (yymsg);
1700 #endif
1701   /* Make sure YYID is used.  */
1702   return YYID (yyresult);
1703 }
1704
1705
1706
1707 /* Line 1675 of yacc.c  */
1708 #line 140 "heimdal/lib/com_err/parse.y"
1709
1710
1711 static long
1712 name2number(const char *str)
1713 {
1714     const char *p;
1715     long num = 0;
1716     const char *x = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
1717         "abcdefghijklmnopqrstuvwxyz0123456789_";
1718     if(strlen(str) > 4) {
1719         yyerror("table name too long");
1720         return 0;
1721     }
1722     for(p = str; *p; p++){
1723         char *q = strchr(x, *p);
1724         if(q == NULL) {
1725             yyerror("invalid character in table name");
1726             return 0;
1727         }
1728         num = (num << 6) + (q - x) + 1;
1729     }
1730     num <<= 8;
1731     if(num > 0x7fffffff)
1732         num = -(0xffffffff - num + 1);
1733     return num;
1734 }
1735
1736 void
1737 yyerror (char *s)
1738 {
1739      error_message ("%s\n", s);
1740 }
1741