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