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