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
122 /* Copy the first part of user declarations. */
126 #include "amrecover.h"
128 void yyerror(char *s);
129 extern int yylex(void);
130 extern char * yytext;
134 /* Enabling traces. */
139 /* Enabling verbose error messages. */
140 #ifdef YYERROR_VERBOSE
141 # undef YYERROR_VERBOSE
142 # define YYERROR_VERBOSE 1
144 # define YYERROR_VERBOSE 0
147 /* Enabling the token table. */
148 #ifndef YYTOKEN_TABLE
149 # define YYTOKEN_TABLE 0
152 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
154 typedef union YYSTYPE {
160 /* Line 196 of yacc.c. */
162 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
163 # define YYSTYPE_IS_DECLARED 1
164 # define YYSTYPE_IS_TRIVIAL 1
169 /* Copy the second part of user declarations. */
172 /* Line 219 of yacc.c. */
175 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
176 # define YYSIZE_T __SIZE_TYPE__
178 #if ! defined (YYSIZE_T) && defined (size_t)
179 # define YYSIZE_T size_t
181 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
182 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
183 # define YYSIZE_T size_t
185 #if ! defined (YYSIZE_T)
186 # define YYSIZE_T unsigned int
192 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
193 # define YY_(msgid) dgettext ("bison-runtime", msgid)
197 # define YY_(msgid) msgid
201 #if ! defined (yyoverflow) || YYERROR_VERBOSE
203 /* The parser invokes alloca or malloc; define the necessary symbols. */
205 # ifdef YYSTACK_USE_ALLOCA
206 # if YYSTACK_USE_ALLOCA
208 # define YYSTACK_ALLOC __builtin_alloca
210 # define YYSTACK_ALLOC alloca
211 # if defined (__STDC__) || defined (__cplusplus)
212 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
213 # define YYINCLUDED_STDLIB_H
219 # ifdef YYSTACK_ALLOC
220 /* Pacify GCC's `empty if-body' warning. */
221 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
222 # ifndef YYSTACK_ALLOC_MAXIMUM
223 /* The OS might guarantee only one guard page at the bottom of the stack,
224 and a page size can be as small as 4096 bytes. So we cannot safely
225 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
226 to allow for a few compiler-allocated temporary stack slots. */
227 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
230 # define YYSTACK_ALLOC YYMALLOC
231 # define YYSTACK_FREE YYFREE
232 # ifndef YYSTACK_ALLOC_MAXIMUM
233 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
239 # define YYMALLOC malloc
240 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
241 && (defined (__STDC__) || defined (__cplusplus)))
242 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
247 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
248 && (defined (__STDC__) || defined (__cplusplus)))
249 void free (void *); /* INFRINGES ON USER NAME SPACE */
256 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
259 #if (! defined (yyoverflow) \
260 && (! defined (__cplusplus) \
261 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
263 /* A type that is properly aligned for any stack member. */
270 /* The size of the maximum gap between one aligned stack and the next. */
271 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
273 /* The size of an array large to enough to hold all stacks, each with
275 # define YYSTACK_BYTES(N) \
276 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
277 + YYSTACK_GAP_MAXIMUM)
279 /* Copy COUNT objects from FROM to TO. The source and destination do
282 # if defined (__GNUC__) && 1 < __GNUC__
283 # define YYCOPY(To, From, Count) \
284 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
286 # define YYCOPY(To, From, Count) \
290 for (yyi = 0; yyi < (Count); yyi++) \
291 (To)[yyi] = (From)[yyi]; \
297 /* Relocate STACK from its old location to the new one. The
298 local variables YYSIZE and YYSTACKSIZE give the old and new number of
299 elements in the stack, and YYPTR gives the new location of the
300 stack. Advance YYPTR to a properly aligned location for the next
302 # define YYSTACK_RELOCATE(Stack) \
305 YYSIZE_T yynewbytes; \
306 YYCOPY (&yyptr->Stack, Stack, yysize); \
307 Stack = &yyptr->Stack; \
308 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
309 yyptr += yynewbytes / sizeof (*yyptr); \
315 #if defined (__STDC__) || defined (__cplusplus)
316 typedef signed char yysigned_char;
318 typedef short int yysigned_char;
321 /* YYFINAL -- State number of the termination state. */
323 /* YYLAST -- Last index in YYTABLE. */
326 /* YYNTOKENS -- Number of terminals. */
328 /* YYNNTS -- Number of nonterminals. */
330 /* YYNRULES -- Number of rules. */
332 /* YYNRULES -- Number of states. */
335 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
337 #define YYMAXUTOK 285
339 #define YYTRANSLATE(YYX) \
340 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
342 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
343 static const unsigned char yytranslate[] =
345 0, 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, 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, 1, 2, 3, 4,
371 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
372 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
373 25, 26, 27, 28, 29, 30
377 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
379 static const unsigned char yyprhs[] =
381 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
382 19, 21, 23, 24, 26, 29, 31, 34, 37, 41,
383 44, 47, 49, 52, 55, 58, 61, 63, 65, 68,
384 70, 72, 74, 76, 78, 81, 84, 86, 89, 92,
385 94, 97, 100, 102, 105, 108, 110, 112, 115, 117
388 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
389 static const yysigned_char yyrhs[] =
391 32, 0, -1, 33, -1, 34, -1, 35, -1, 36,
392 -1, 38, -1, 40, -1, 42, -1, 44, -1, 45,
393 -1, 46, -1, -1, 3, -1, 4, 29, -1, 4,
394 -1, 7, 30, -1, 5, 29, -1, 6, 29, 29,
395 -1, 6, 29, -1, 8, 29, -1, 8, -1, 10,
396 29, -1, 11, 29, -1, 9, 27, -1, 9, 28,
397 -1, 13, -1, 14, -1, 18, 29, -1, 18, -1,
398 21, -1, 22, -1, 26, -1, 12, -1, 15, 37,
399 -1, 37, 29, -1, 29, -1, 16, 39, -1, 39,
400 29, -1, 29, -1, 19, 41, -1, 41, 29, -1,
401 29, -1, 20, 43, -1, 43, 29, -1, 29, -1,
402 25, -1, 24, 29, -1, 23, -1, 17, -1
405 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
406 static const unsigned char yyrline[] =
408 0, 65, 65, 66, 67, 68, 69, 70, 71, 72,
409 73, 74, 75, 84, 85, 86, 87, 88, 89, 90,
410 91, 92, 93, 94, 95, 100, 108, 109, 110, 111,
411 112, 113, 114, 118, 122, 126, 127, 131, 135, 136,
412 140, 144, 145, 149, 153, 154, 158, 159, 168, 172
416 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
417 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
418 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
419 static const char *const yytname[] =
421 "$end", "error", "$undefined", "LISTHOST", "LISTDISK", "SETHOST",
422 "SETDISK", "SETDATE", "SETTAPE", "SETMODE", "CD", "CDX", "QUIT", "DHIST",
423 "LS", "ADD", "ADDX", "EXTRACT", "LIST", "DELETE", "DELETEX", "PWD",
424 "CLEAR", "HELP", "LCD", "LPWD", "MODE", "SMB", "TAR", "PATH", "DATE",
425 "$accept", "ucommand", "set_command", "display_command", "quit_command",
426 "add_command", "add_path", "addx_command", "addx_path", "delete_command",
427 "delete_path", "deletex_command", "deletex_path", "local_command",
428 "help_command", "extract_command", 0
433 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
435 static const unsigned short int yytoknum[] =
437 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
438 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
439 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
444 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
445 static const unsigned char yyr1[] =
447 0, 31, 32, 32, 32, 32, 32, 32, 32, 32,
448 32, 32, 32, 33, 33, 33, 33, 33, 33, 33,
449 33, 33, 33, 33, 33, 33, 34, 34, 34, 34,
450 34, 34, 34, 35, 36, 37, 37, 38, 39, 39,
451 40, 41, 41, 42, 43, 43, 44, 44, 45, 46
454 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
455 static const unsigned char yyr2[] =
457 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
458 1, 1, 0, 1, 2, 1, 2, 2, 3, 2,
459 2, 1, 2, 2, 2, 2, 1, 1, 2, 1,
460 1, 1, 1, 1, 2, 2, 1, 2, 2, 1,
461 2, 2, 1, 2, 2, 1, 1, 2, 1, 1
464 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
465 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
466 means the default is an error. */
467 static const unsigned char yydefact[] =
469 12, 13, 15, 0, 0, 0, 21, 0, 0, 0,
470 33, 26, 27, 0, 0, 49, 29, 0, 0, 30,
471 31, 48, 0, 46, 32, 0, 2, 3, 4, 5,
472 6, 7, 8, 9, 10, 11, 14, 17, 19, 16,
473 20, 24, 25, 22, 23, 36, 34, 39, 37, 28,
474 42, 40, 45, 43, 47, 1, 18, 35, 38, 41,
478 /* YYDEFGOTO[NTERM-NUM]. */
479 static const yysigned_char yydefgoto[] =
481 -1, 25, 26, 27, 28, 29, 46, 30, 48, 31,
482 51, 32, 53, 33, 34, 35
485 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
487 #define YYPACT_NINF -6
488 static const yysigned_char yypact[] =
490 -3, -6, -5, -1, 0, 1, 3, -2, 4, 5,
491 -6, -6, -6, 6, 7, -6, 8, 9, 10, -6,
492 -6, -6, 11, -6, -6, 27, -6, -6, -6, -6,
493 -6, -6, -6, -6, -6, -6, -6, -6, 12, -6,
494 -6, -6, -6, -6, -6, -6, 13, -6, 14, -6,
495 -6, 15, -6, 16, -6, -6, -6, -6, -6, -6,
499 /* YYPGOTO[NTERM-NUM]. */
500 static const yysigned_char yypgoto[] =
502 -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
503 -6, -6, -6, -6, -6, -6
506 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
507 positive, shift that token. If negative, reduce the rule which
508 number is the opposite. If zero, do what YYDEFACT says.
509 If YYTABLE_NINF, syntax error. */
510 #define YYTABLE_NINF -1
511 static const unsigned char yytable[] =
513 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
514 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
515 21, 22, 23, 24, 36, 41, 42, 55, 37, 38,
516 0, 39, 40, 43, 44, 45, 47, 49, 50, 52,
517 54, 56, 57, 58, 59, 60
520 static const yysigned_char yycheck[] =
522 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
523 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
524 23, 24, 25, 26, 29, 27, 28, 0, 29, 29,
525 -1, 30, 29, 29, 29, 29, 29, 29, 29, 29,
526 29, 29, 29, 29, 29, 29
529 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
530 symbol of state STATE-NUM. */
531 static const unsigned char yystos[] =
533 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
534 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
535 22, 23, 24, 25, 26, 32, 33, 34, 35, 36,
536 38, 40, 42, 44, 45, 46, 29, 29, 29, 30,
537 29, 27, 28, 29, 29, 29, 37, 29, 39, 29,
538 29, 41, 29, 43, 29, 0, 29, 29, 29, 29,
542 #define yyerrok (yyerrstatus = 0)
543 #define yyclearin (yychar = YYEMPTY)
547 #define YYACCEPT goto yyacceptlab
548 #define YYABORT goto yyabortlab
549 #define YYERROR goto yyerrorlab
552 /* Like YYERROR except do call yyerror. This remains here temporarily
553 to ease the transition to the new meaning of YYERROR, for GCC.
554 Once GCC version 2 has supplanted version 1, this can go. */
556 #define YYFAIL goto yyerrlab
558 #define YYRECOVERING() (!!yyerrstatus)
560 #define YYBACKUP(Token, Value) \
562 if (yychar == YYEMPTY && yylen == 1) \
566 yytoken = YYTRANSLATE (yychar); \
572 yyerror (YY_("syntax error: cannot back up")); \
579 #define YYERRCODE 256
582 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
583 If N is 0, then set CURRENT to the empty location which ends
584 the previous symbol: RHS[0] (always defined). */
586 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
587 #ifndef YYLLOC_DEFAULT
588 # define YYLLOC_DEFAULT(Current, Rhs, N) \
592 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
593 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
594 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
595 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
599 (Current).first_line = (Current).last_line = \
600 YYRHSLOC (Rhs, 0).last_line; \
601 (Current).first_column = (Current).last_column = \
602 YYRHSLOC (Rhs, 0).last_column; \
608 /* YY_LOCATION_PRINT -- Print the location on the stream.
609 This macro was not mandated originally: define only if we know
610 we won't break user code: when these are the locations we know. */
612 #ifndef YY_LOCATION_PRINT
613 # if YYLTYPE_IS_TRIVIAL
614 # define YY_LOCATION_PRINT(File, Loc) \
615 fprintf (File, "%d.%d-%d.%d", \
616 (Loc).first_line, (Loc).first_column, \
617 (Loc).last_line, (Loc).last_column)
619 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
624 /* YYLEX -- calling `yylex' with the right arguments. */
627 # define YYLEX yylex (YYLEX_PARAM)
629 # define YYLEX yylex ()
632 /* Enable debugging if requested. */
636 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
637 # define YYFPRINTF fprintf
640 # define YYDPRINTF(Args) \
646 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
650 YYFPRINTF (stderr, "%s ", Title); \
651 yysymprint (stderr, \
653 YYFPRINTF (stderr, "\n"); \
657 /*------------------------------------------------------------------.
658 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
660 `------------------------------------------------------------------*/
662 #if defined (__STDC__) || defined (__cplusplus)
664 yy_stack_print (short int *bottom, short int *top)
667 yy_stack_print (bottom, top)
672 YYFPRINTF (stderr, "Stack now");
673 for (/* Nothing. */; bottom <= top; ++bottom)
674 YYFPRINTF (stderr, " %d", *bottom);
675 YYFPRINTF (stderr, "\n");
678 # define YY_STACK_PRINT(Bottom, Top) \
681 yy_stack_print ((Bottom), (Top)); \
685 /*------------------------------------------------.
686 | Report that the YYRULE is going to be reduced. |
687 `------------------------------------------------*/
689 #if defined (__STDC__) || defined (__cplusplus)
691 yy_reduce_print (int yyrule)
694 yy_reduce_print (yyrule)
699 unsigned long int yylno = yyrline[yyrule];
700 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
702 /* Print the symbols being reduced, and their result. */
703 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
704 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
705 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
708 # define YY_REDUCE_PRINT(Rule) \
711 yy_reduce_print (Rule); \
714 /* Nonzero means print parse trace. It is left uninitialized so that
715 multiple parsers can coexist. */
718 # define YYDPRINTF(Args)
719 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
720 # define YY_STACK_PRINT(Bottom, Top)
721 # define YY_REDUCE_PRINT(Rule)
722 #endif /* !YYDEBUG */
725 /* YYINITDEPTH -- initial size of the parser's stacks. */
727 # define YYINITDEPTH 200
730 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
731 if the built-in stack extension method is used).
733 Do not make this value too large; the results are undefined if
734 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
735 evaluated with infinite-precision integer arithmetic. */
738 # define YYMAXDEPTH 10000
746 # if defined (__GLIBC__) && defined (_STRING_H)
747 # define yystrlen strlen
749 /* Return the length of YYSTR. */
751 # if defined (__STDC__) || defined (__cplusplus)
752 yystrlen (const char *yystr)
758 const char *yys = yystr;
760 while (*yys++ != '\0')
763 return yys - yystr - 1;
769 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
770 # define yystpcpy stpcpy
772 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
775 # if defined (__STDC__) || defined (__cplusplus)
776 yystpcpy (char *yydest, const char *yysrc)
778 yystpcpy (yydest, yysrc)
784 const char *yys = yysrc;
786 while ((*yyd++ = *yys++) != '\0')
795 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
796 quotes and backslashes, so that it's suitable for yyerror. The
797 heuristic is that double-quoting is unnecessary unless the string
798 contains an apostrophe, a comma, or backslash (other than
799 backslash-backslash). YYSTR is taken from yytname. If YYRES is
800 null, do not copy; instead, return the length of what the result
803 yytnamerr (char *yyres, const char *yystr)
808 char const *yyp = yystr;
815 goto do_not_strip_quotes;
819 goto do_not_strip_quotes;
832 do_not_strip_quotes: ;
836 return yystrlen (yystr);
838 return yystpcpy (yyres, yystr) - yyres;
842 #endif /* YYERROR_VERBOSE */
847 /*--------------------------------.
848 | Print this symbol on YYOUTPUT. |
849 `--------------------------------*/
851 #if defined (__STDC__) || defined (__cplusplus)
853 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
856 yysymprint (yyoutput, yytype, yyvaluep)
862 /* Pacify ``unused variable'' warnings. */
865 if (yytype < YYNTOKENS)
866 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
868 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
872 if (yytype < YYNTOKENS)
873 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
880 YYFPRINTF (yyoutput, ")");
883 #endif /* ! YYDEBUG */
884 /*-----------------------------------------------.
885 | Release the memory associated to this symbol. |
886 `-----------------------------------------------*/
888 #if defined (__STDC__) || defined (__cplusplus)
890 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
893 yydestruct (yymsg, yytype, yyvaluep)
899 /* Pacify ``unused variable'' warnings. */
904 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
915 /* Prevent warnings from -Wmissing-prototypes. */
918 # if defined (__STDC__) || defined (__cplusplus)
919 int yyparse (void *YYPARSE_PARAM);
923 #else /* ! YYPARSE_PARAM */
924 #if defined (__STDC__) || defined (__cplusplus)
929 #endif /* ! YYPARSE_PARAM */
933 /* The look-ahead symbol. */
936 /* The semantic value of the look-ahead symbol. */
939 /* Number of syntax errors so far. */
949 # if defined (__STDC__) || defined (__cplusplus)
950 int yyparse (void *YYPARSE_PARAM)
952 int yyparse (YYPARSE_PARAM)
955 #else /* ! YYPARSE_PARAM */
956 #if defined (__STDC__) || defined (__cplusplus)
970 /* Number of tokens to shift before error messages enabled. */
972 /* Look-ahead token as an internal (translated) token number. */
975 /* Three stacks and their tools:
976 `yyss': related to states,
977 `yyvs': related to semantic values,
978 `yyls': related to locations.
980 Refer to the stacks thru separate pointers, to allow yyoverflow
981 to reallocate them elsewhere. */
983 /* The state stack. */
984 short int yyssa[YYINITDEPTH];
985 short int *yyss = yyssa;
988 /* The semantic value stack. */
989 YYSTYPE yyvsa[YYINITDEPTH];
990 YYSTYPE *yyvs = yyvsa;
995 #define YYPOPSTACK (yyvsp--, yyssp--)
997 YYSIZE_T yystacksize = YYINITDEPTH;
999 /* The variables used to return semantic value and location from the
1004 /* When reducing, the number of symbols on the RHS of the reduced
1008 YYDPRINTF ((stderr, "Starting parse\n"));
1013 yychar = YYEMPTY; /* Cause a token to be read. */
1015 /* Initialize stack pointers.
1016 Waste one element of value and location stack
1017 so that they stay on the same level as the state stack.
1018 The wasted elements are never initialized. */
1025 /*------------------------------------------------------------.
1026 | yynewstate -- Push a new state, which is found in yystate. |
1027 `------------------------------------------------------------*/
1029 /* In all cases, when you get here, the value and location stacks
1030 have just been pushed. so pushing a state here evens the stacks.
1037 if (yyss + yystacksize - 1 <= yyssp)
1039 /* Get the current used size of the three stacks, in elements. */
1040 YYSIZE_T yysize = yyssp - yyss + 1;
1044 /* Give user a chance to reallocate the stack. Use copies of
1045 these so that the &'s don't force the real ones into
1047 YYSTYPE *yyvs1 = yyvs;
1048 short int *yyss1 = yyss;
1051 /* Each stack pointer address is followed by the size of the
1052 data in use in that stack, in bytes. This used to be a
1053 conditional around just the two extra args, but that might
1054 be undefined if yyoverflow is a macro. */
1055 yyoverflow (YY_("memory exhausted"),
1056 &yyss1, yysize * sizeof (*yyssp),
1057 &yyvs1, yysize * sizeof (*yyvsp),
1064 #else /* no yyoverflow */
1065 # ifndef YYSTACK_RELOCATE
1066 goto yyexhaustedlab;
1068 /* Extend the stack our own way. */
1069 if (YYMAXDEPTH <= yystacksize)
1070 goto yyexhaustedlab;
1072 if (YYMAXDEPTH < yystacksize)
1073 yystacksize = YYMAXDEPTH;
1076 short int *yyss1 = yyss;
1077 union yyalloc *yyptr =
1078 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1080 goto yyexhaustedlab;
1081 YYSTACK_RELOCATE (yyss);
1082 YYSTACK_RELOCATE (yyvs);
1084 # undef YYSTACK_RELOCATE
1086 YYSTACK_FREE (yyss1);
1089 #endif /* no yyoverflow */
1091 yyssp = yyss + yysize - 1;
1092 yyvsp = yyvs + yysize - 1;
1095 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1096 (unsigned long int) yystacksize));
1098 if (yyss + yystacksize - 1 <= yyssp)
1102 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1111 /* Do appropriate processing given the current state. */
1112 /* Read a look-ahead token if we need one and don't already have one. */
1115 /* First try to decide what to do without reference to look-ahead token. */
1117 yyn = yypact[yystate];
1118 if (yyn == YYPACT_NINF)
1121 /* Not known => get a look-ahead token if don't already have one. */
1123 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1124 if (yychar == YYEMPTY)
1126 YYDPRINTF ((stderr, "Reading a token: "));
1130 if (yychar <= YYEOF)
1132 yychar = yytoken = YYEOF;
1133 YYDPRINTF ((stderr, "Now at end of input.\n"));
1137 yytoken = YYTRANSLATE (yychar);
1138 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1141 /* If the proper action on seeing token YYTOKEN is to reduce or to
1142 detect an error, take that action. */
1144 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1149 if (yyn == 0 || yyn == YYTABLE_NINF)
1158 /* Shift the look-ahead token. */
1159 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1161 /* Discard the token being shifted unless it is eof. */
1162 if (yychar != YYEOF)
1168 /* Count tokens shifted since error; after three, turn off error
1177 /*-----------------------------------------------------------.
1178 | yydefault -- do the default action for the current state. |
1179 `-----------------------------------------------------------*/
1181 yyn = yydefact[yystate];
1187 /*-----------------------------.
1188 | yyreduce -- Do a reduction. |
1189 `-----------------------------*/
1191 /* yyn is the number of a rule to reduce with. */
1194 /* If YYLEN is nonzero, implement the default value of the action:
1197 Otherwise, the following line sets YYVAL to garbage.
1198 This behavior is undocumented and Bison
1199 users should not rely upon it. Assigning to YYVAL
1200 unconditionally makes the parser a bit smaller, and it avoids a
1201 GCC warning that YYVAL may be used uninitialized. */
1202 yyval = yyvsp[1-yylen];
1205 YY_REDUCE_PRINT (yyn);
1211 char * errstr = vstralloc("Invalid command: ", yytext, NULL);
1225 { list_disk((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1230 { list_disk(NULL); }
1235 { set_date((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1240 { set_host((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1245 { set_disk((yyvsp[-1].strval), (yyvsp[0].strval)); amfree((yyvsp[-1].strval)); amfree((yyvsp[0].strval)); }
1250 { set_disk((yyvsp[0].strval), NULL); amfree((yyvsp[0].strval)); }
1255 { set_tape((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1265 { cd_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1270 { cd_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1277 set_mode(SAMBA_SMBCLIENT);
1278 #endif /* SAMBA_CLIENT */
1283 #line 100 "uparse.y"
1286 set_mode(SAMBA_TAR);
1287 #endif /* SAMBA_CLIENT */
1292 #line 108 "uparse.y"
1293 { list_disk_history(); }
1297 #line 109 "uparse.y"
1298 { list_directory(); }
1302 #line 110 "uparse.y"
1303 { display_extract_list((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1307 #line 111 "uparse.y"
1308 { display_extract_list(NULL); }
1312 #line 112 "uparse.y"
1313 { show_directory(); }
1317 #line 113 "uparse.y"
1318 { clear_extract_list(); }
1322 #line 114 "uparse.y"
1327 #line 118 "uparse.y"
1332 #line 126 "uparse.y"
1333 { add_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1337 #line 127 "uparse.y"
1338 { add_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1342 #line 135 "uparse.y"
1343 { add_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1347 #line 136 "uparse.y"
1348 { add_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1352 #line 144 "uparse.y"
1353 { delete_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1357 #line 145 "uparse.y"
1358 { delete_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1362 #line 153 "uparse.y"
1363 { delete_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1367 #line 154 "uparse.y"
1368 { delete_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1372 #line 158 "uparse.y"
1373 { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); }
1377 #line 159 "uparse.y"
1379 if (chdir((yyvsp[0].strval)) == -1) {
1380 perror((yyvsp[0].strval));
1382 amfree((yyvsp[0].strval));
1387 #line 168 "uparse.y"
1392 #line 172 "uparse.y"
1393 { extract_files(); }
1400 /* Line 1126 of yacc.c. */
1401 #line 1402 "uparse.c"
1407 YY_STACK_PRINT (yyss, yyssp);
1412 /* Now `shift' the result of the reduction. Determine what state
1413 that goes to, based on the state we popped back to and the rule
1414 number reduced by. */
1418 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1419 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1420 yystate = yytable[yystate];
1422 yystate = yydefgoto[yyn - YYNTOKENS];
1427 /*------------------------------------.
1428 | yyerrlab -- here on detecting error |
1429 `------------------------------------*/
1431 /* If not already recovering from an error, report this error. */
1436 yyn = yypact[yystate];
1438 if (YYPACT_NINF < yyn && yyn < YYLAST)
1440 int yytype = YYTRANSLATE (yychar);
1441 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1442 YYSIZE_T yysize = yysize0;
1444 int yysize_overflow = 0;
1446 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
1447 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1451 /* This is so xgettext sees the translatable formats that are
1452 constructed on the fly. */
1453 YY_("syntax error, unexpected %s");
1454 YY_("syntax error, unexpected %s, expecting %s");
1455 YY_("syntax error, unexpected %s, expecting %s or %s");
1456 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1457 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1461 static char const yyunexpected[] = "syntax error, unexpected %s";
1462 static char const yyexpecting[] = ", expecting %s";
1463 static char const yyor[] = " or %s";
1464 char yyformat[sizeof yyunexpected
1465 + sizeof yyexpecting - 1
1466 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1467 * (sizeof yyor - 1))];
1468 char const *yyprefix = yyexpecting;
1470 /* Start YYX at -YYN if negative to avoid negative indexes in
1472 int yyxbegin = yyn < 0 ? -yyn : 0;
1474 /* Stay within bounds of both yycheck and yytname. */
1475 int yychecklim = YYLAST - yyn;
1476 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1479 yyarg[0] = yytname[yytype];
1480 yyfmt = yystpcpy (yyformat, yyunexpected);
1482 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1483 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1485 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1489 yyformat[sizeof yyunexpected - 1] = '\0';
1492 yyarg[yycount++] = yytname[yyx];
1493 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1494 yysize_overflow |= yysize1 < yysize;
1496 yyfmt = yystpcpy (yyfmt, yyprefix);
1500 yyf = YY_(yyformat);
1501 yysize1 = yysize + yystrlen (yyf);
1502 yysize_overflow |= yysize1 < yysize;
1505 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
1506 yymsg = (char *) YYSTACK_ALLOC (yysize);
1509 /* Avoid sprintf, as that infringes on the user's name space.
1510 Don't have undefined behavior even if the translation
1511 produced a string with the wrong number of "%s"s. */
1514 while ((*yyp = *yyf))
1516 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1518 yyp += yytnamerr (yyp, yyarg[yyi++]);
1528 YYSTACK_FREE (yymsg);
1532 yyerror (YY_("syntax error"));
1533 goto yyexhaustedlab;
1537 #endif /* YYERROR_VERBOSE */
1538 yyerror (YY_("syntax error"));
1543 if (yyerrstatus == 3)
1545 /* If just tried and failed to reuse look-ahead token after an
1546 error, discard it. */
1548 if (yychar <= YYEOF)
1550 /* Return failure if at end of input. */
1551 if (yychar == YYEOF)
1556 yydestruct ("Error: discarding", yytoken, &yylval);
1561 /* Else will try to reuse look-ahead token after shifting the error
1566 /*---------------------------------------------------.
1567 | yyerrorlab -- error raised explicitly by YYERROR. |
1568 `---------------------------------------------------*/
1571 /* Pacify compilers like GCC when the user code never invokes
1572 YYERROR and the label yyerrorlab therefore never appears in user
1583 /*-------------------------------------------------------------.
1584 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1585 `-------------------------------------------------------------*/
1587 yyerrstatus = 3; /* Each real token shifted decrements this. */
1591 yyn = yypact[yystate];
1592 if (yyn != YYPACT_NINF)
1595 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1603 /* Pop the current state because it cannot handle the error token. */
1608 yydestruct ("Error: popping", yystos[yystate], yyvsp);
1611 YY_STACK_PRINT (yyss, yyssp);
1620 /* Shift the error token. */
1621 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1627 /*-------------------------------------.
1628 | yyacceptlab -- YYACCEPT comes here. |
1629 `-------------------------------------*/
1634 /*-----------------------------------.
1635 | yyabortlab -- YYABORT comes here. |
1636 `-----------------------------------*/
1642 /*-------------------------------------------------.
1643 | yyexhaustedlab -- memory exhaustion comes here. |
1644 `-------------------------------------------------*/
1646 yyerror (YY_("memory exhausted"));
1652 if (yychar != YYEOF && yychar != YYEMPTY)
1653 yydestruct ("Cleanup: discarding lookahead",
1655 while (yyssp != yyss)
1657 yydestruct ("Cleanup: popping",
1658 yystos[*yyssp], yyvsp);
1663 YYSTACK_FREE (yyss);
1669 #line 176 "uparse.y"