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