1 /* A Bison parser, made by GNU Bison 2.1. */
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.
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)
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.
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. */
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. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
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. */
36 /* Identify Bison output. */
40 #define YYBISON_VERSION "2.1"
43 #define YYSKELETON_NAME "yacc.c"
48 /* Using locations. */
49 #define YYLSP_NEEDED 0
56 /* Put the tokens into the symbol table, so that GDB and other debuggers
120 /* Copy the first part of user declarations. */
124 #include "amrecover.h"
126 void yyerror P((char *s));
127 extern int yylex P((void));
130 /* Enabling traces. */
135 /* Enabling verbose error messages. */
136 #ifdef YYERROR_VERBOSE
137 # undef YYERROR_VERBOSE
138 # define YYERROR_VERBOSE 1
140 # define YYERROR_VERBOSE 0
143 /* Enabling the token table. */
144 #ifndef YYTOKEN_TABLE
145 # define YYTOKEN_TABLE 0
148 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
150 typedef union YYSTYPE {
156 /* Line 196 of yacc.c. */
158 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
159 # define YYSTYPE_IS_DECLARED 1
160 # define YYSTYPE_IS_TRIVIAL 1
165 /* Copy the second part of user declarations. */
168 /* Line 219 of yacc.c. */
171 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
172 # define YYSIZE_T __SIZE_TYPE__
174 #if ! defined (YYSIZE_T) && defined (size_t)
175 # define YYSIZE_T size_t
177 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
178 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
179 # define YYSIZE_T size_t
181 #if ! defined (YYSIZE_T)
182 # define YYSIZE_T unsigned int
188 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
189 # define YY_(msgid) dgettext ("bison-runtime", msgid)
193 # define YY_(msgid) msgid
197 #if ! defined (yyoverflow) || YYERROR_VERBOSE
199 /* The parser invokes alloca or malloc; define the necessary symbols. */
201 # ifdef YYSTACK_USE_ALLOCA
202 # if YYSTACK_USE_ALLOCA
204 # define YYSTACK_ALLOC __builtin_alloca
206 # define YYSTACK_ALLOC alloca
207 # if defined (__STDC__) || defined (__cplusplus)
208 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
209 # define YYINCLUDED_STDLIB_H
215 # ifdef YYSTACK_ALLOC
216 /* Pacify GCC's `empty if-body' warning. */
217 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
218 # ifndef YYSTACK_ALLOC_MAXIMUM
219 /* The OS might guarantee only one guard page at the bottom of the stack,
220 and a page size can be as small as 4096 bytes. So we cannot safely
221 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
222 to allow for a few compiler-allocated temporary stack slots. */
223 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
226 # define YYSTACK_ALLOC YYMALLOC
227 # define YYSTACK_FREE YYFREE
228 # ifndef YYSTACK_ALLOC_MAXIMUM
229 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
235 # define YYMALLOC malloc
236 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
237 && (defined (__STDC__) || defined (__cplusplus)))
238 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
243 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
244 && (defined (__STDC__) || defined (__cplusplus)))
245 void free (void *); /* INFRINGES ON USER NAME SPACE */
252 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
255 #if (! defined (yyoverflow) \
256 && (! defined (__cplusplus) \
257 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
259 /* A type that is properly aligned for any stack member. */
266 /* The size of the maximum gap between one aligned stack and the next. */
267 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
269 /* The size of an array large to enough to hold all stacks, each with
271 # define YYSTACK_BYTES(N) \
272 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
273 + YYSTACK_GAP_MAXIMUM)
275 /* Copy COUNT objects from FROM to TO. The source and destination do
278 # if defined (__GNUC__) && 1 < __GNUC__
279 # define YYCOPY(To, From, Count) \
280 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
282 # define YYCOPY(To, From, Count) \
286 for (yyi = 0; yyi < (Count); yyi++) \
287 (To)[yyi] = (From)[yyi]; \
293 /* Relocate STACK from its old location to the new one. The
294 local variables YYSIZE and YYSTACKSIZE give the old and new number of
295 elements in the stack, and YYPTR gives the new location of the
296 stack. Advance YYPTR to a properly aligned location for the next
298 # define YYSTACK_RELOCATE(Stack) \
301 YYSIZE_T yynewbytes; \
302 YYCOPY (&yyptr->Stack, Stack, yysize); \
303 Stack = &yyptr->Stack; \
304 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
305 yyptr += yynewbytes / sizeof (*yyptr); \
311 #if defined (__STDC__) || defined (__cplusplus)
312 typedef signed char yysigned_char;
314 typedef short int yysigned_char;
317 /* YYFINAL -- State number of the termination state. */
319 /* YYLAST -- Last index in YYTABLE. */
322 /* YYNTOKENS -- Number of terminals. */
324 /* YYNNTS -- Number of nonterminals. */
326 /* YYNRULES -- Number of rules. */
328 /* YYNRULES -- Number of states. */
331 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
333 #define YYMAXUTOK 284
335 #define YYTRANSLATE(YYX) \
336 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
338 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
339 static const unsigned char yytranslate[] =
341 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
342 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
343 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
344 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
345 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
346 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
347 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
348 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
349 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
350 2, 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 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
367 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
368 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
373 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
375 static const unsigned char yyprhs[] =
377 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
378 19, 21, 23, 26, 28, 31, 34, 38, 41, 44,
379 46, 49, 52, 55, 58, 60, 62, 65, 67, 69,
380 71, 73, 75, 78, 81, 83, 86, 89, 91, 94,
381 97, 99, 102, 105, 107, 109, 112, 114
384 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
385 static const yysigned_char yyrhs[] =
387 31, 0, -1, 32, -1, 33, -1, 34, -1, 35,
388 -1, 37, -1, 39, -1, 41, -1, 43, -1, 44,
389 -1, 45, -1, 3, 28, -1, 3, -1, 6, 29,
390 -1, 4, 28, -1, 5, 28, 28, -1, 5, 28,
391 -1, 7, 28, -1, 7, -1, 9, 28, -1, 10,
392 28, -1, 8, 26, -1, 8, 27, -1, 12, -1,
393 13, -1, 17, 28, -1, 17, -1, 20, -1, 21,
394 -1, 25, -1, 11, -1, 14, 36, -1, 36, 28,
395 -1, 28, -1, 15, 38, -1, 38, 28, -1, 28,
396 -1, 18, 40, -1, 40, 28, -1, 28, -1, 19,
397 42, -1, 42, 28, -1, 28, -1, 24, -1, 23,
398 28, -1, 22, -1, 16, -1
401 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
402 static const unsigned char yyrline[] =
404 0, 63, 63, 64, 65, 66, 67, 68, 69, 70,
405 71, 72, 76, 77, 78, 79, 80, 81, 82, 83,
406 84, 85, 86, 91, 99, 100, 101, 102, 103, 104,
407 105, 109, 113, 117, 118, 122, 126, 127, 131, 135,
408 136, 140, 144, 145, 149, 150, 159, 163
412 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
413 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
414 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
415 static const char *const yytname[] =
417 "$end", "error", "$undefined", "LISTDISK", "SETHOST", "SETDISK",
418 "SETDATE", "SETTAPE", "SETMODE", "CD", "CDX", "QUIT", "DHIST", "LS",
419 "ADD", "ADDX", "EXTRACT", "LIST", "DELETE", "DELETEX", "PWD", "CLEAR",
420 "HELP", "LCD", "LPWD", "MODE", "SMB", "TAR", "PATH", "DATE", "$accept",
421 "ucommand", "set_command", "display_command", "quit_command",
422 "add_command", "add_path", "addx_command", "addx_path", "delete_command",
423 "delete_path", "deletex_command", "deletex_path", "local_command",
424 "help_command", "extract_command", 0
429 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
431 static const unsigned short int yytoknum[] =
433 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
434 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
435 275, 276, 277, 278, 279, 280, 281, 282, 283, 284
439 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
440 static const unsigned char yyr1[] =
442 0, 30, 31, 31, 31, 31, 31, 31, 31, 31,
443 31, 31, 32, 32, 32, 32, 32, 32, 32, 32,
444 32, 32, 32, 32, 33, 33, 33, 33, 33, 33,
445 33, 34, 35, 36, 36, 37, 38, 38, 39, 40,
446 40, 41, 42, 42, 43, 43, 44, 45
449 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
450 static const unsigned char yyr2[] =
452 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
453 1, 1, 2, 1, 2, 2, 3, 2, 2, 1,
454 2, 2, 2, 2, 1, 1, 2, 1, 1, 1,
455 1, 1, 2, 2, 1, 2, 2, 1, 2, 2,
456 1, 2, 2, 1, 1, 2, 1, 1
459 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
460 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
461 means the default is an error. */
462 static const unsigned char yydefact[] =
464 0, 13, 0, 0, 0, 19, 0, 0, 0, 31,
465 24, 25, 0, 0, 47, 27, 0, 0, 28, 29,
466 46, 0, 44, 30, 0, 2, 3, 4, 5, 6,
467 7, 8, 9, 10, 11, 12, 15, 17, 14, 18,
468 22, 23, 20, 21, 34, 32, 37, 35, 26, 40,
469 38, 43, 41, 45, 1, 16, 33, 36, 39, 42
472 /* YYDEFGOTO[NTERM-NUM]. */
473 static const yysigned_char yydefgoto[] =
475 -1, 24, 25, 26, 27, 28, 45, 29, 47, 30,
476 50, 31, 52, 32, 33, 34
479 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
481 #define YYPACT_NINF -6
482 static const yysigned_char yypact[] =
484 -3, -5, -1, 0, 1, 3, -2, 4, 5, -6,
485 -6, -6, 6, 7, -6, 8, 9, 10, -6, -6,
486 -6, 11, -6, -6, 26, -6, -6, -6, -6, -6,
487 -6, -6, -6, -6, -6, -6, -6, 12, -6, -6,
488 -6, -6, -6, -6, -6, 13, -6, 14, -6, -6,
489 15, -6, 16, -6, -6, -6, -6, -6, -6, -6
492 /* YYPGOTO[NTERM-NUM]. */
493 static const yysigned_char yypgoto[] =
495 -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
496 -6, -6, -6, -6, -6, -6
499 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
500 positive, shift that token. If negative, reduce the rule which
501 number is the opposite. If zero, do what YYDEFACT says.
502 If YYTABLE_NINF, syntax error. */
503 #define YYTABLE_NINF -1
504 static const unsigned char yytable[] =
506 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
507 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
508 21, 22, 23, 35, 40, 41, 54, 36, 37, 0,
509 38, 39, 42, 43, 44, 46, 48, 49, 51, 53,
513 static const yysigned_char yycheck[] =
515 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
516 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
517 23, 24, 25, 28, 26, 27, 0, 28, 28, -1,
518 29, 28, 28, 28, 28, 28, 28, 28, 28, 28,
522 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
523 symbol of state STATE-NUM. */
524 static const unsigned char yystos[] =
526 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
527 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
528 22, 23, 24, 25, 31, 32, 33, 34, 35, 37,
529 39, 41, 43, 44, 45, 28, 28, 28, 29, 28,
530 26, 27, 28, 28, 28, 36, 28, 38, 28, 28,
531 40, 28, 42, 28, 0, 28, 28, 28, 28, 28
534 #define yyerrok (yyerrstatus = 0)
535 #define yyclearin (yychar = YYEMPTY)
539 #define YYACCEPT goto yyacceptlab
540 #define YYABORT goto yyabortlab
541 #define YYERROR goto yyerrorlab
544 /* Like YYERROR except do call yyerror. This remains here temporarily
545 to ease the transition to the new meaning of YYERROR, for GCC.
546 Once GCC version 2 has supplanted version 1, this can go. */
548 #define YYFAIL goto yyerrlab
550 #define YYRECOVERING() (!!yyerrstatus)
552 #define YYBACKUP(Token, Value) \
554 if (yychar == YYEMPTY && yylen == 1) \
558 yytoken = YYTRANSLATE (yychar); \
564 yyerror (YY_("syntax error: cannot back up")); \
571 #define YYERRCODE 256
574 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
575 If N is 0, then set CURRENT to the empty location which ends
576 the previous symbol: RHS[0] (always defined). */
578 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
579 #ifndef YYLLOC_DEFAULT
580 # define YYLLOC_DEFAULT(Current, Rhs, N) \
584 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
585 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
586 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
587 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
591 (Current).first_line = (Current).last_line = \
592 YYRHSLOC (Rhs, 0).last_line; \
593 (Current).first_column = (Current).last_column = \
594 YYRHSLOC (Rhs, 0).last_column; \
600 /* YY_LOCATION_PRINT -- Print the location on the stream.
601 This macro was not mandated originally: define only if we know
602 we won't break user code: when these are the locations we know. */
604 #ifndef YY_LOCATION_PRINT
605 # if YYLTYPE_IS_TRIVIAL
606 # define YY_LOCATION_PRINT(File, Loc) \
607 fprintf (File, "%d.%d-%d.%d", \
608 (Loc).first_line, (Loc).first_column, \
609 (Loc).last_line, (Loc).last_column)
611 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
616 /* YYLEX -- calling `yylex' with the right arguments. */
619 # define YYLEX yylex (YYLEX_PARAM)
621 # define YYLEX yylex ()
624 /* Enable debugging if requested. */
628 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
629 # define YYFPRINTF fprintf
632 # define YYDPRINTF(Args) \
638 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
642 YYFPRINTF (stderr, "%s ", Title); \
643 yysymprint (stderr, \
645 YYFPRINTF (stderr, "\n"); \
649 /*------------------------------------------------------------------.
650 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
652 `------------------------------------------------------------------*/
654 #if defined (__STDC__) || defined (__cplusplus)
656 yy_stack_print (short int *bottom, short int *top)
659 yy_stack_print (bottom, top)
664 YYFPRINTF (stderr, "Stack now");
665 for (/* Nothing. */; bottom <= top; ++bottom)
666 YYFPRINTF (stderr, " %d", *bottom);
667 YYFPRINTF (stderr, "\n");
670 # define YY_STACK_PRINT(Bottom, Top) \
673 yy_stack_print ((Bottom), (Top)); \
677 /*------------------------------------------------.
678 | Report that the YYRULE is going to be reduced. |
679 `------------------------------------------------*/
681 #if defined (__STDC__) || defined (__cplusplus)
683 yy_reduce_print (int yyrule)
686 yy_reduce_print (yyrule)
691 unsigned long int yylno = yyrline[yyrule];
692 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
694 /* Print the symbols being reduced, and their result. */
695 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
696 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
697 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
700 # define YY_REDUCE_PRINT(Rule) \
703 yy_reduce_print (Rule); \
706 /* Nonzero means print parse trace. It is left uninitialized so that
707 multiple parsers can coexist. */
710 # define YYDPRINTF(Args)
711 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
712 # define YY_STACK_PRINT(Bottom, Top)
713 # define YY_REDUCE_PRINT(Rule)
714 #endif /* !YYDEBUG */
717 /* YYINITDEPTH -- initial size of the parser's stacks. */
719 # define YYINITDEPTH 200
722 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
723 if the built-in stack extension method is used).
725 Do not make this value too large; the results are undefined if
726 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
727 evaluated with infinite-precision integer arithmetic. */
730 # define YYMAXDEPTH 10000
738 # if defined (__GLIBC__) && defined (_STRING_H)
739 # define yystrlen strlen
741 /* Return the length of YYSTR. */
743 # if defined (__STDC__) || defined (__cplusplus)
744 yystrlen (const char *yystr)
750 const char *yys = yystr;
752 while (*yys++ != '\0')
755 return yys - yystr - 1;
761 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
762 # define yystpcpy stpcpy
764 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
767 # if defined (__STDC__) || defined (__cplusplus)
768 yystpcpy (char *yydest, const char *yysrc)
770 yystpcpy (yydest, yysrc)
776 const char *yys = yysrc;
778 while ((*yyd++ = *yys++) != '\0')
787 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
788 quotes and backslashes, so that it's suitable for yyerror. The
789 heuristic is that double-quoting is unnecessary unless the string
790 contains an apostrophe, a comma, or backslash (other than
791 backslash-backslash). YYSTR is taken from yytname. If YYRES is
792 null, do not copy; instead, return the length of what the result
795 yytnamerr (char *yyres, const char *yystr)
800 char const *yyp = yystr;
807 goto do_not_strip_quotes;
811 goto do_not_strip_quotes;
824 do_not_strip_quotes: ;
828 return yystrlen (yystr);
830 return yystpcpy (yyres, yystr) - yyres;
834 #endif /* YYERROR_VERBOSE */
839 /*--------------------------------.
840 | Print this symbol on YYOUTPUT. |
841 `--------------------------------*/
843 #if defined (__STDC__) || defined (__cplusplus)
845 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
848 yysymprint (yyoutput, yytype, yyvaluep)
854 /* Pacify ``unused variable'' warnings. */
857 if (yytype < YYNTOKENS)
858 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
860 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
864 if (yytype < YYNTOKENS)
865 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
872 YYFPRINTF (yyoutput, ")");
875 #endif /* ! YYDEBUG */
876 /*-----------------------------------------------.
877 | Release the memory associated to this symbol. |
878 `-----------------------------------------------*/
880 #if defined (__STDC__) || defined (__cplusplus)
882 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
885 yydestruct (yymsg, yytype, yyvaluep)
891 /* Pacify ``unused variable'' warnings. */
896 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
907 /* Prevent warnings from -Wmissing-prototypes. */
910 # if defined (__STDC__) || defined (__cplusplus)
911 int yyparse (void *YYPARSE_PARAM);
915 #else /* ! YYPARSE_PARAM */
916 #if defined (__STDC__) || defined (__cplusplus)
921 #endif /* ! YYPARSE_PARAM */
925 /* The look-ahead symbol. */
928 /* The semantic value of the look-ahead symbol. */
931 /* Number of syntax errors so far. */
941 # if defined (__STDC__) || defined (__cplusplus)
942 int yyparse (void *YYPARSE_PARAM)
944 int yyparse (YYPARSE_PARAM)
947 #else /* ! YYPARSE_PARAM */
948 #if defined (__STDC__) || defined (__cplusplus)
962 /* Number of tokens to shift before error messages enabled. */
964 /* Look-ahead token as an internal (translated) token number. */
967 /* Three stacks and their tools:
968 `yyss': related to states,
969 `yyvs': related to semantic values,
970 `yyls': related to locations.
972 Refer to the stacks thru separate pointers, to allow yyoverflow
973 to reallocate them elsewhere. */
975 /* The state stack. */
976 short int yyssa[YYINITDEPTH];
977 short int *yyss = yyssa;
980 /* The semantic value stack. */
981 YYSTYPE yyvsa[YYINITDEPTH];
982 YYSTYPE *yyvs = yyvsa;
987 #define YYPOPSTACK (yyvsp--, yyssp--)
989 YYSIZE_T yystacksize = YYINITDEPTH;
991 /* The variables used to return semantic value and location from the
996 /* When reducing, the number of symbols on the RHS of the reduced
1000 YYDPRINTF ((stderr, "Starting parse\n"));
1005 yychar = YYEMPTY; /* Cause a token to be read. */
1007 /* Initialize stack pointers.
1008 Waste one element of value and location stack
1009 so that they stay on the same level as the state stack.
1010 The wasted elements are never initialized. */
1017 /*------------------------------------------------------------.
1018 | yynewstate -- Push a new state, which is found in yystate. |
1019 `------------------------------------------------------------*/
1021 /* In all cases, when you get here, the value and location stacks
1022 have just been pushed. so pushing a state here evens the stacks.
1029 if (yyss + yystacksize - 1 <= yyssp)
1031 /* Get the current used size of the three stacks, in elements. */
1032 YYSIZE_T yysize = yyssp - yyss + 1;
1036 /* Give user a chance to reallocate the stack. Use copies of
1037 these so that the &'s don't force the real ones into
1039 YYSTYPE *yyvs1 = yyvs;
1040 short int *yyss1 = yyss;
1043 /* Each stack pointer address is followed by the size of the
1044 data in use in that stack, in bytes. This used to be a
1045 conditional around just the two extra args, but that might
1046 be undefined if yyoverflow is a macro. */
1047 yyoverflow (YY_("memory exhausted"),
1048 &yyss1, yysize * sizeof (*yyssp),
1049 &yyvs1, yysize * sizeof (*yyvsp),
1056 #else /* no yyoverflow */
1057 # ifndef YYSTACK_RELOCATE
1058 goto yyexhaustedlab;
1060 /* Extend the stack our own way. */
1061 if (YYMAXDEPTH <= yystacksize)
1062 goto yyexhaustedlab;
1064 if (YYMAXDEPTH < yystacksize)
1065 yystacksize = YYMAXDEPTH;
1068 short int *yyss1 = yyss;
1069 union yyalloc *yyptr =
1070 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1072 goto yyexhaustedlab;
1073 YYSTACK_RELOCATE (yyss);
1074 YYSTACK_RELOCATE (yyvs);
1076 # undef YYSTACK_RELOCATE
1078 YYSTACK_FREE (yyss1);
1081 #endif /* no yyoverflow */
1083 yyssp = yyss + yysize - 1;
1084 yyvsp = yyvs + yysize - 1;
1087 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1088 (unsigned long int) yystacksize));
1090 if (yyss + yystacksize - 1 <= yyssp)
1094 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1103 /* Do appropriate processing given the current state. */
1104 /* Read a look-ahead token if we need one and don't already have one. */
1107 /* First try to decide what to do without reference to look-ahead token. */
1109 yyn = yypact[yystate];
1110 if (yyn == YYPACT_NINF)
1113 /* Not known => get a look-ahead token if don't already have one. */
1115 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1116 if (yychar == YYEMPTY)
1118 YYDPRINTF ((stderr, "Reading a token: "));
1122 if (yychar <= YYEOF)
1124 yychar = yytoken = YYEOF;
1125 YYDPRINTF ((stderr, "Now at end of input.\n"));
1129 yytoken = YYTRANSLATE (yychar);
1130 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1133 /* If the proper action on seeing token YYTOKEN is to reduce or to
1134 detect an error, take that action. */
1136 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1141 if (yyn == 0 || yyn == YYTABLE_NINF)
1150 /* Shift the look-ahead token. */
1151 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1153 /* Discard the token being shifted unless it is eof. */
1154 if (yychar != YYEOF)
1160 /* Count tokens shifted since error; after three, turn off error
1169 /*-----------------------------------------------------------.
1170 | yydefault -- do the default action for the current state. |
1171 `-----------------------------------------------------------*/
1173 yyn = yydefact[yystate];
1179 /*-----------------------------.
1180 | yyreduce -- Do a reduction. |
1181 `-----------------------------*/
1183 /* yyn is the number of a rule to reduce with. */
1186 /* If YYLEN is nonzero, implement the default value of the action:
1189 Otherwise, the following line sets YYVAL to garbage.
1190 This behavior is undocumented and Bison
1191 users should not rely upon it. Assigning to YYVAL
1192 unconditionally makes the parser a bit smaller, and it avoids a
1193 GCC warning that YYVAL may be used uninitialized. */
1194 yyval = yyvsp[1-yylen];
1197 YY_REDUCE_PRINT (yyn);
1202 { list_disk((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1207 { list_disk(NULL); }
1212 { set_date((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1217 { set_host((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1222 { set_disk((yyvsp[-1].strval), (yyvsp[0].strval)); amfree((yyvsp[-1].strval)); amfree((yyvsp[0].strval)); }
1227 { set_disk((yyvsp[0].strval), NULL); amfree((yyvsp[0].strval)); }
1232 { set_tape((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1242 { cd_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1247 { cd_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1254 set_mode(SAMBA_SMBCLIENT);
1255 #endif /* SAMBA_CLIENT */
1263 set_mode(SAMBA_TAR);
1264 #endif /* SAMBA_CLIENT */
1270 { list_disk_history(); }
1274 #line 100 "uparse.y"
1275 { list_directory(); }
1279 #line 101 "uparse.y"
1280 { display_extract_list((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1284 #line 102 "uparse.y"
1285 { display_extract_list(NULL); }
1289 #line 103 "uparse.y"
1290 { show_directory(); }
1294 #line 104 "uparse.y"
1295 { clear_extract_list(); }
1299 #line 105 "uparse.y"
1304 #line 109 "uparse.y"
1309 #line 117 "uparse.y"
1310 { add_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1314 #line 118 "uparse.y"
1315 { add_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1319 #line 126 "uparse.y"
1320 { add_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1324 #line 127 "uparse.y"
1325 { add_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1329 #line 135 "uparse.y"
1330 { delete_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1334 #line 136 "uparse.y"
1335 { delete_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1339 #line 144 "uparse.y"
1340 { delete_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1344 #line 145 "uparse.y"
1345 { delete_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1349 #line 149 "uparse.y"
1350 { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); }
1354 #line 150 "uparse.y"
1356 if (chdir((yyvsp[0].strval)) == -1) {
1357 perror((yyvsp[0].strval));
1359 amfree((yyvsp[0].strval));
1364 #line 159 "uparse.y"
1369 #line 163 "uparse.y"
1370 { extract_files(); }
1377 /* Line 1126 of yacc.c. */
1378 #line 1379 "uparse.c"
1384 YY_STACK_PRINT (yyss, yyssp);
1389 /* Now `shift' the result of the reduction. Determine what state
1390 that goes to, based on the state we popped back to and the rule
1391 number reduced by. */
1395 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1396 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1397 yystate = yytable[yystate];
1399 yystate = yydefgoto[yyn - YYNTOKENS];
1404 /*------------------------------------.
1405 | yyerrlab -- here on detecting error |
1406 `------------------------------------*/
1408 /* If not already recovering from an error, report this error. */
1413 yyn = yypact[yystate];
1415 if (YYPACT_NINF < yyn && yyn < YYLAST)
1417 int yytype = YYTRANSLATE (yychar);
1418 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1419 YYSIZE_T yysize = yysize0;
1421 int yysize_overflow = 0;
1423 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
1424 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1428 /* This is so xgettext sees the translatable formats that are
1429 constructed on the fly. */
1430 YY_("syntax error, unexpected %s");
1431 YY_("syntax error, unexpected %s, expecting %s");
1432 YY_("syntax error, unexpected %s, expecting %s or %s");
1433 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1434 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1438 static char const yyunexpected[] = "syntax error, unexpected %s";
1439 static char const yyexpecting[] = ", expecting %s";
1440 static char const yyor[] = " or %s";
1441 char yyformat[sizeof yyunexpected
1442 + sizeof yyexpecting - 1
1443 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1444 * (sizeof yyor - 1))];
1445 char const *yyprefix = yyexpecting;
1447 /* Start YYX at -YYN if negative to avoid negative indexes in
1449 int yyxbegin = yyn < 0 ? -yyn : 0;
1451 /* Stay within bounds of both yycheck and yytname. */
1452 int yychecklim = YYLAST - yyn;
1453 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1456 yyarg[0] = yytname[yytype];
1457 yyfmt = yystpcpy (yyformat, yyunexpected);
1459 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1460 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1462 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1466 yyformat[sizeof yyunexpected - 1] = '\0';
1469 yyarg[yycount++] = yytname[yyx];
1470 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1471 yysize_overflow |= yysize1 < yysize;
1473 yyfmt = yystpcpy (yyfmt, yyprefix);
1477 yyf = YY_(yyformat);
1478 yysize1 = yysize + yystrlen (yyf);
1479 yysize_overflow |= yysize1 < yysize;
1482 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
1483 yymsg = (char *) YYSTACK_ALLOC (yysize);
1486 /* Avoid sprintf, as that infringes on the user's name space.
1487 Don't have undefined behavior even if the translation
1488 produced a string with the wrong number of "%s"s. */
1491 while ((*yyp = *yyf))
1493 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1495 yyp += yytnamerr (yyp, yyarg[yyi++]);
1505 YYSTACK_FREE (yymsg);
1509 yyerror (YY_("syntax error"));
1510 goto yyexhaustedlab;
1514 #endif /* YYERROR_VERBOSE */
1515 yyerror (YY_("syntax error"));
1520 if (yyerrstatus == 3)
1522 /* If just tried and failed to reuse look-ahead token after an
1523 error, discard it. */
1525 if (yychar <= YYEOF)
1527 /* Return failure if at end of input. */
1528 if (yychar == YYEOF)
1533 yydestruct ("Error: discarding", yytoken, &yylval);
1538 /* Else will try to reuse look-ahead token after shifting the error
1543 /*---------------------------------------------------.
1544 | yyerrorlab -- error raised explicitly by YYERROR. |
1545 `---------------------------------------------------*/
1548 /* Pacify compilers like GCC when the user code never invokes
1549 YYERROR and the label yyerrorlab therefore never appears in user
1560 /*-------------------------------------------------------------.
1561 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1562 `-------------------------------------------------------------*/
1564 yyerrstatus = 3; /* Each real token shifted decrements this. */
1568 yyn = yypact[yystate];
1569 if (yyn != YYPACT_NINF)
1572 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1580 /* Pop the current state because it cannot handle the error token. */
1585 yydestruct ("Error: popping", yystos[yystate], yyvsp);
1588 YY_STACK_PRINT (yyss, yyssp);
1597 /* Shift the error token. */
1598 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1604 /*-------------------------------------.
1605 | yyacceptlab -- YYACCEPT comes here. |
1606 `-------------------------------------*/
1611 /*-----------------------------------.
1612 | yyabortlab -- YYABORT comes here. |
1613 `-----------------------------------*/
1619 /*-------------------------------------------------.
1620 | yyexhaustedlab -- memory exhaustion comes here. |
1621 `-------------------------------------------------*/
1623 yyerror (YY_("memory exhausted"));
1629 if (yychar != YYEOF && yychar != YYEMPTY)
1630 yydestruct ("Cleanup: discarding lookahead",
1632 while (yyssp != yyss)
1634 yydestruct ("Cleanup: popping",
1635 yystos[*yyssp], yyvsp);
1640 YYSTACK_FREE (yyss);
1646 #line 167 "uparse.y"
1652 printf("Invalid command - %s\n", s);