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)
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. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
66 /* Put the tokens into the symbol table, so that GDB and other debuggers
132 /* Copy the first part of user declarations. */
136 #include "amrecover.h"
138 void yyerror(char *s);
139 extern int yylex(void);
140 extern char * yytext;
144 /* Enabling traces. */
149 /* Enabling verbose error messages. */
150 #ifdef YYERROR_VERBOSE
151 # undef YYERROR_VERBOSE
152 # define YYERROR_VERBOSE 1
154 # define YYERROR_VERBOSE 0
157 /* Enabling the token table. */
158 #ifndef YYTOKEN_TABLE
159 # define YYTOKEN_TABLE 0
162 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
163 typedef union YYSTYPE
171 /* Line 187 of yacc.c. */
174 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
175 # define YYSTYPE_IS_DECLARED 1
176 # define YYSTYPE_IS_TRIVIAL 1
181 /* Copy the second part of user declarations. */
184 /* Line 216 of yacc.c. */
192 typedef YYTYPE_UINT8 yytype_uint8;
194 typedef unsigned char yytype_uint8;
198 typedef YYTYPE_INT8 yytype_int8;
199 #elif (defined __STDC__ || defined __C99__FUNC__ \
200 || defined __cplusplus || defined _MSC_VER)
201 typedef signed char yytype_int8;
203 typedef short int yytype_int8;
207 typedef YYTYPE_UINT16 yytype_uint16;
209 typedef unsigned short int yytype_uint16;
213 typedef YYTYPE_INT16 yytype_int16;
215 typedef short int yytype_int16;
219 # ifdef __SIZE_TYPE__
220 # define YYSIZE_T __SIZE_TYPE__
221 # elif defined size_t
222 # define YYSIZE_T size_t
223 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
224 || defined __cplusplus || defined _MSC_VER)
225 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
226 # define YYSIZE_T size_t
228 # define YYSIZE_T unsigned int
232 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
237 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
238 # define YY_(msgid) dgettext ("bison-runtime", msgid)
242 # define YY_(msgid) msgid
246 /* Suppress unused-variable warnings by "using" E. */
247 #if ! defined lint || defined __GNUC__
248 # define YYUSE(e) ((void) (e))
250 # define YYUSE(e) /* empty */
253 /* Identity function, used to suppress warnings about constant conditions. */
257 #if (defined __STDC__ || defined __C99__FUNC__ \
258 || defined __cplusplus || defined _MSC_VER)
271 #if ! defined yyoverflow || YYERROR_VERBOSE
273 /* The parser invokes alloca or malloc; define the necessary symbols. */
275 # ifdef YYSTACK_USE_ALLOCA
276 # if YYSTACK_USE_ALLOCA
278 # define YYSTACK_ALLOC __builtin_alloca
279 # elif defined __BUILTIN_VA_ARG_INCR
280 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
282 # define YYSTACK_ALLOC __alloca
283 # elif defined _MSC_VER
284 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
285 # define alloca _alloca
287 # define YYSTACK_ALLOC alloca
288 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
289 || defined __cplusplus || defined _MSC_VER)
290 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
299 # ifdef YYSTACK_ALLOC
300 /* Pacify GCC's `empty if-body' warning. */
301 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
302 # ifndef YYSTACK_ALLOC_MAXIMUM
303 /* The OS might guarantee only one guard page at the bottom of the stack,
304 and a page size can be as small as 4096 bytes. So we cannot safely
305 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
306 to allow for a few compiler-allocated temporary stack slots. */
307 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
310 # define YYSTACK_ALLOC YYMALLOC
311 # define YYSTACK_FREE YYFREE
312 # ifndef YYSTACK_ALLOC_MAXIMUM
313 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
315 # if (defined __cplusplus && ! defined _STDLIB_H \
316 && ! ((defined YYMALLOC || defined malloc) \
317 && (defined YYFREE || defined free)))
318 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
324 # define YYMALLOC malloc
325 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
326 || defined __cplusplus || defined _MSC_VER)
327 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
332 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
333 || defined __cplusplus || defined _MSC_VER)
334 void free (void *); /* INFRINGES ON USER NAME SPACE */
338 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
341 #if (! defined yyoverflow \
342 && (! defined __cplusplus \
343 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
345 /* A type that is properly aligned for any stack member. */
352 /* The size of the maximum gap between one aligned stack and the next. */
353 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
355 /* The size of an array large to enough to hold all stacks, each with
357 # define YYSTACK_BYTES(N) \
358 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
359 + YYSTACK_GAP_MAXIMUM)
361 /* Copy COUNT objects from FROM to TO. The source and destination do
364 # if defined __GNUC__ && 1 < __GNUC__
365 # define YYCOPY(To, From, Count) \
366 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
368 # define YYCOPY(To, From, Count) \
372 for (yyi = 0; yyi < (Count); yyi++) \
373 (To)[yyi] = (From)[yyi]; \
379 /* Relocate STACK from its old location to the new one. The
380 local variables YYSIZE and YYSTACKSIZE give the old and new number of
381 elements in the stack, and YYPTR gives the new location of the
382 stack. Advance YYPTR to a properly aligned location for the next
384 # define YYSTACK_RELOCATE(Stack) \
387 YYSIZE_T yynewbytes; \
388 YYCOPY (&yyptr->Stack, Stack, yysize); \
389 Stack = &yyptr->Stack; \
390 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
391 yyptr += yynewbytes / sizeof (*yyptr); \
397 /* YYFINAL -- State number of the termination state. */
399 /* YYLAST -- Last index in YYTABLE. */
402 /* YYNTOKENS -- Number of terminals. */
404 /* YYNNTS -- Number of nonterminals. */
406 /* YYNRULES -- Number of rules. */
408 /* YYNRULES -- Number of states. */
411 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
413 #define YYMAXUTOK 285
415 #define YYTRANSLATE(YYX) \
416 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
418 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
419 static const yytype_uint8 yytranslate[] =
421 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
447 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
448 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
449 25, 26, 27, 28, 29, 30
453 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
455 static const yytype_uint8 yyprhs[] =
457 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
458 19, 21, 23, 24, 26, 29, 31, 34, 37, 41,
459 44, 47, 49, 52, 55, 58, 61, 63, 65, 68,
460 70, 72, 74, 76, 78, 81, 84, 86, 89, 92,
461 94, 97, 100, 102, 105, 108, 110, 112, 115, 117
464 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
465 static const yytype_int8 yyrhs[] =
467 32, 0, -1, 33, -1, 34, -1, 35, -1, 36,
468 -1, 38, -1, 40, -1, 42, -1, 44, -1, 45,
469 -1, 46, -1, -1, 3, -1, 4, 29, -1, 4,
470 -1, 7, 30, -1, 5, 29, -1, 6, 29, 29,
471 -1, 6, 29, -1, 8, 29, -1, 8, -1, 10,
472 29, -1, 11, 29, -1, 9, 27, -1, 9, 28,
473 -1, 13, -1, 14, -1, 18, 29, -1, 18, -1,
474 21, -1, 22, -1, 26, -1, 12, -1, 15, 37,
475 -1, 37, 29, -1, 29, -1, 16, 39, -1, 39,
476 29, -1, 29, -1, 19, 41, -1, 41, 29, -1,
477 29, -1, 20, 43, -1, 43, 29, -1, 29, -1,
478 25, -1, 24, 29, -1, 23, -1, 17, -1
481 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
482 static const yytype_uint8 yyrline[] =
484 0, 65, 65, 66, 67, 68, 69, 70, 71, 72,
485 73, 74, 75, 84, 85, 86, 87, 88, 89, 90,
486 91, 92, 93, 94, 95, 100, 108, 109, 110, 111,
487 112, 113, 114, 118, 122, 126, 127, 131, 135, 136,
488 140, 144, 145, 149, 153, 154, 158, 159, 166, 170
492 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
493 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
494 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
495 static const char *const yytname[] =
497 "$end", "error", "$undefined", "LISTHOST", "LISTDISK", "SETHOST",
498 "SETDISK", "SETDATE", "SETTAPE", "SETMODE", "CD", "CDX", "QUIT", "DHIST",
499 "LS", "ADD", "ADDX", "EXTRACT", "LIST", "DELETE", "DELETEX", "PWD",
500 "CLEAR", "HELP", "LCD", "LPWD", "MODE", "SMB", "TAR", "PATH", "DATE",
501 "$accept", "ucommand", "set_command", "display_command", "quit_command",
502 "add_command", "add_path", "addx_command", "addx_path", "delete_command",
503 "delete_path", "deletex_command", "deletex_path", "local_command",
504 "help_command", "extract_command", 0
509 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
511 static const yytype_uint16 yytoknum[] =
513 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
514 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
515 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
520 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
521 static const yytype_uint8 yyr1[] =
523 0, 31, 32, 32, 32, 32, 32, 32, 32, 32,
524 32, 32, 32, 33, 33, 33, 33, 33, 33, 33,
525 33, 33, 33, 33, 33, 33, 34, 34, 34, 34,
526 34, 34, 34, 35, 36, 37, 37, 38, 39, 39,
527 40, 41, 41, 42, 43, 43, 44, 44, 45, 46
530 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
531 static const yytype_uint8 yyr2[] =
533 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
534 1, 1, 0, 1, 2, 1, 2, 2, 3, 2,
535 2, 1, 2, 2, 2, 2, 1, 1, 2, 1,
536 1, 1, 1, 1, 2, 2, 1, 2, 2, 1,
537 2, 2, 1, 2, 2, 1, 1, 2, 1, 1
540 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
541 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
542 means the default is an error. */
543 static const yytype_uint8 yydefact[] =
545 12, 13, 15, 0, 0, 0, 21, 0, 0, 0,
546 33, 26, 27, 0, 0, 49, 29, 0, 0, 30,
547 31, 48, 0, 46, 32, 0, 2, 3, 4, 5,
548 6, 7, 8, 9, 10, 11, 14, 17, 19, 16,
549 20, 24, 25, 22, 23, 36, 34, 39, 37, 28,
550 42, 40, 45, 43, 47, 1, 18, 35, 38, 41,
554 /* YYDEFGOTO[NTERM-NUM]. */
555 static const yytype_int8 yydefgoto[] =
557 -1, 25, 26, 27, 28, 29, 46, 30, 48, 31,
558 51, 32, 53, 33, 34, 35
561 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
563 #define YYPACT_NINF -6
564 static const yytype_int8 yypact[] =
566 -3, -6, -5, -1, 0, 1, 3, -2, 4, 5,
567 -6, -6, -6, 6, 7, -6, 8, 9, 10, -6,
568 -6, -6, 11, -6, -6, 27, -6, -6, -6, -6,
569 -6, -6, -6, -6, -6, -6, -6, -6, 12, -6,
570 -6, -6, -6, -6, -6, -6, 13, -6, 14, -6,
571 -6, 15, -6, 16, -6, -6, -6, -6, -6, -6,
575 /* YYPGOTO[NTERM-NUM]. */
576 static const yytype_int8 yypgoto[] =
578 -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
579 -6, -6, -6, -6, -6, -6
582 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
583 positive, shift that token. If negative, reduce the rule which
584 number is the opposite. If zero, do what YYDEFACT says.
585 If YYTABLE_NINF, syntax error. */
586 #define YYTABLE_NINF -1
587 static const yytype_uint8 yytable[] =
589 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
590 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
591 21, 22, 23, 24, 36, 41, 42, 55, 37, 38,
592 0, 39, 40, 43, 44, 45, 47, 49, 50, 52,
593 54, 56, 57, 58, 59, 60
596 static const yytype_int8 yycheck[] =
598 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
599 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
600 23, 24, 25, 26, 29, 27, 28, 0, 29, 29,
601 -1, 30, 29, 29, 29, 29, 29, 29, 29, 29,
602 29, 29, 29, 29, 29, 29
605 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
606 symbol of state STATE-NUM. */
607 static const yytype_uint8 yystos[] =
609 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
610 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
611 22, 23, 24, 25, 26, 32, 33, 34, 35, 36,
612 38, 40, 42, 44, 45, 46, 29, 29, 29, 30,
613 29, 27, 28, 29, 29, 29, 37, 29, 39, 29,
614 29, 41, 29, 43, 29, 0, 29, 29, 29, 29,
618 #define yyerrok (yyerrstatus = 0)
619 #define yyclearin (yychar = YYEMPTY)
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) \
638 if (yychar == YYEMPTY && yylen == 1) \
642 yytoken = YYTRANSLATE (yychar); \
648 yyerror (YY_("syntax error: cannot back up")); \
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) \
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; \
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; \
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 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)
695 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
700 /* YYLEX -- calling `yylex' with the right arguments. */
703 # define YYLEX yylex (YYLEX_PARAM)
705 # define YYLEX yylex ()
708 /* Enable debugging if requested. */
712 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
713 # define YYFPRINTF fprintf
716 # define YYDPRINTF(Args) \
722 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
726 YYFPRINTF (stderr, "%s ", Title); \
727 yy_symbol_print (stderr, \
729 YYFPRINTF (stderr, "\n"); \
734 /*--------------------------------.
735 | Print this symbol on YYOUTPUT. |
736 `--------------------------------*/
739 #if (defined __STDC__ || defined __C99__FUNC__ \
740 || defined __cplusplus || defined _MSC_VER)
742 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
745 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
748 YYSTYPE const * const yyvaluep;
754 if (yytype < YYNTOKENS)
755 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
767 /*--------------------------------.
768 | Print this symbol on YYOUTPUT. |
769 `--------------------------------*/
771 #if (defined __STDC__ || defined __C99__FUNC__ \
772 || defined __cplusplus || defined _MSC_VER)
774 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
777 yy_symbol_print (yyoutput, yytype, yyvaluep)
780 YYSTYPE const * const yyvaluep;
783 if (yytype < YYNTOKENS)
784 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
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 |
795 `------------------------------------------------------------------*/
797 #if (defined __STDC__ || defined __C99__FUNC__ \
798 || defined __cplusplus || defined _MSC_VER)
800 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
803 yy_stack_print (bottom, top)
804 yytype_int16 *bottom;
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) \
817 yy_stack_print ((Bottom), (Top)); \
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)
828 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
831 yy_reduce_print (yyvsp, yyrule)
836 int yynrhs = yyr2[yyrule];
838 unsigned long int yylno = yyrline[yyrule];
839 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
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) \
855 yy_reduce_print (yyvsp, Rule); \
858 /* Nonzero means print parse trace. It is left uninitialized so that
859 multiple parsers can coexist. */
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. */
871 # define YYINITDEPTH 200
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. */
882 # define YYMAXDEPTH 10000
890 # if defined __GLIBC__ && defined _STRING_H
891 # define yystrlen strlen
893 /* Return the length of YYSTR. */
894 #if (defined __STDC__ || defined __C99__FUNC__ \
895 || defined __cplusplus || defined _MSC_VER)
897 yystrlen (const char *yystr)
905 for (yylen = 0; yystr[yylen]; yylen++)
913 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
914 # define yystpcpy stpcpy
916 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
918 #if (defined __STDC__ || defined __C99__FUNC__ \
919 || defined __cplusplus || defined _MSC_VER)
921 yystpcpy (char *yydest, const char *yysrc)
924 yystpcpy (yydest, yysrc)
930 const char *yys = yysrc;
932 while ((*yyd++ = *yys++) != '\0')
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
949 yytnamerr (char *yyres, const char *yystr)
954 char const *yyp = yystr;
961 goto do_not_strip_quotes;
965 goto do_not_strip_quotes;
978 do_not_strip_quotes: ;
982 return yystrlen (yystr);
984 return yystpcpy (yyres, yystr) - yyres;
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
996 yysyntax_error (char *yyresult, int yystate, int yychar)
998 int yyn = yypact[yystate];
1000 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1004 int yytype = YYTRANSLATE (yychar);
1005 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1006 YYSIZE_T yysize = yysize0;
1008 int yysize_overflow = 0;
1009 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1010 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
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");
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
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;
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)
1052 yyformat[sizeof yyunexpected - 1] = '\0';
1055 yyarg[yycount++] = yytname[yyx];
1056 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1057 yysize_overflow |= (yysize1 < yysize);
1059 yyfmt = yystpcpy (yyfmt, yyprefix);
1063 yyf = YY_(yyformat);
1064 yysize1 = yysize + yystrlen (yyf);
1065 yysize_overflow |= (yysize1 < yysize);
1068 if (yysize_overflow)
1069 return YYSIZE_MAXIMUM;
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;
1078 while ((*yyp = *yyf) != '\0')
1080 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1082 yyp += yytnamerr (yyp, yyarg[yyi++]);
1095 #endif /* YYERROR_VERBOSE */
1098 /*-----------------------------------------------.
1099 | Release the memory associated to this symbol. |
1100 `-----------------------------------------------*/
1103 #if (defined __STDC__ || defined __C99__FUNC__ \
1104 || defined __cplusplus || defined _MSC_VER)
1106 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1109 yydestruct (yymsg, yytype, yyvaluep)
1119 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1130 /* Prevent warnings from -Wmissing-prototypes. */
1132 #ifdef YYPARSE_PARAM
1133 #if defined __STDC__ || defined __cplusplus
1134 int yyparse (void *YYPARSE_PARAM);
1138 #else /* ! YYPARSE_PARAM */
1139 #if defined __STDC__ || defined __cplusplus
1144 #endif /* ! YYPARSE_PARAM */
1148 /* The look-ahead symbol. */
1151 /* The semantic value of the look-ahead symbol. */
1154 /* Number of syntax errors so far. */
1163 #ifdef YYPARSE_PARAM
1164 #if (defined __STDC__ || defined __C99__FUNC__ \
1165 || defined __cplusplus || defined _MSC_VER)
1167 yyparse (void *YYPARSE_PARAM)
1170 yyparse (YYPARSE_PARAM)
1171 void *YYPARSE_PARAM;
1173 #else /* ! YYPARSE_PARAM */
1174 #if (defined __STDC__ || defined __C99__FUNC__ \
1175 || defined __cplusplus || defined _MSC_VER)
1189 /* Number of tokens to shift before error messages enabled. */
1191 /* Look-ahead token as an internal (translated) token number. */
1194 /* Buffer for error messages, and its allocated size. */
1196 char *yymsg = yymsgbuf;
1197 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
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;
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
1229 /* The number of symbols on the RHS of the reduced rule.
1230 Keep to zero when no symbol should be popped. */
1233 YYDPRINTF ((stderr, "Starting parse\n"));
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. */
1250 /*------------------------------------------------------------.
1251 | yynewstate -- Push a new state, which is found in yystate. |
1252 `------------------------------------------------------------*/
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. */
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;
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
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),
1288 #else /* no yyoverflow */
1289 # ifndef YYSTACK_RELOCATE
1290 goto yyexhaustedlab;
1292 /* Extend the stack our own way. */
1293 if (YYMAXDEPTH <= yystacksize)
1294 goto yyexhaustedlab;
1296 if (YYMAXDEPTH < yystacksize)
1297 yystacksize = YYMAXDEPTH;
1300 yytype_int16 *yyss1 = yyss;
1301 union yyalloc *yyptr =
1302 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1304 goto yyexhaustedlab;
1305 YYSTACK_RELOCATE (yyss);
1306 YYSTACK_RELOCATE (yyvs);
1308 # undef YYSTACK_RELOCATE
1310 YYSTACK_FREE (yyss1);
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)
1326 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
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)
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: "));
1352 if (yychar <= YYEOF)
1354 yychar = yytoken = YYEOF;
1355 YYDPRINTF ((stderr, "Now at end of input.\n"));
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. */
1366 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1371 if (yyn == 0 || yyn == YYTABLE_NINF)
1380 /* Count tokens shifted since error; after three, turn off error
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)
1398 /*-----------------------------------------------------------.
1399 | yydefault -- do the default action for the current state. |
1400 `-----------------------------------------------------------*/
1402 yyn = yydefact[yystate];
1408 /*-----------------------------.
1409 | yyreduce -- Do a reduction. |
1410 `-----------------------------*/
1412 /* yyn is the number of a rule to reduce with. */
1415 /* If YYLEN is nonzero, implement the default value of the action:
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);
1432 char * errstr = vstralloc("Invalid command: ", yytext, NULL);
1446 { list_disk((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1451 { list_disk(NULL); }
1456 { set_date((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1461 { set_host((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1466 { set_disk((yyvsp[(2) - (3)].strval), (yyvsp[(3) - (3)].strval)); amfree((yyvsp[(2) - (3)].strval)); amfree((yyvsp[(3) - (3)].strval)); }
1471 { set_disk((yyvsp[(2) - (2)].strval), NULL); amfree((yyvsp[(2) - (2)].strval)); }
1476 { set_tape((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1486 { cd_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1491 { cd_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1498 set_mode(SAMBA_SMBCLIENT);
1499 #endif /* SAMBA_CLIENT */
1504 #line 100 "uparse.y"
1507 set_mode(SAMBA_TAR);
1508 #endif /* SAMBA_CLIENT */
1513 #line 108 "uparse.y"
1514 { list_disk_history(); }
1518 #line 109 "uparse.y"
1519 { list_directory(); }
1523 #line 110 "uparse.y"
1524 { display_extract_list((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1528 #line 111 "uparse.y"
1529 { display_extract_list(NULL); }
1533 #line 112 "uparse.y"
1534 { show_directory(); }
1538 #line 113 "uparse.y"
1539 { clear_extract_list(); }
1543 #line 114 "uparse.y"
1548 #line 118 "uparse.y"
1553 #line 126 "uparse.y"
1554 { add_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1558 #line 127 "uparse.y"
1559 { add_glob((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
1563 #line 135 "uparse.y"
1564 { add_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1568 #line 136 "uparse.y"
1569 { add_regex((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
1573 #line 144 "uparse.y"
1574 { delete_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1578 #line 145 "uparse.y"
1579 { delete_glob((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
1583 #line 153 "uparse.y"
1584 { delete_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1588 #line 154 "uparse.y"
1589 { delete_regex((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
1593 #line 158 "uparse.y"
1594 { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); }
1598 #line 159 "uparse.y"
1600 local_cd((yyvsp[(2) - (2)].strval));
1601 amfree((yyvsp[(2) - (2)].strval));
1606 #line 166 "uparse.y"
1611 #line 170 "uparse.y"
1612 { extract_files(); }
1616 /* Line 1267 of yacc.c. */
1617 #line 1618 "uparse.c"
1620 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1624 YY_STACK_PRINT (yyss, yyssp);
1629 /* Now `shift' the result of the reduction. Determine what state
1630 that goes to, based on the state we popped back to and the rule
1631 number reduced by. */
1635 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1636 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1637 yystate = yytable[yystate];
1639 yystate = yydefgoto[yyn - YYNTOKENS];
1644 /*------------------------------------.
1645 | yyerrlab -- here on detecting error |
1646 `------------------------------------*/
1648 /* If not already recovering from an error, report this error. */
1652 #if ! YYERROR_VERBOSE
1653 yyerror (YY_("syntax error"));
1656 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1657 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1659 YYSIZE_T yyalloc = 2 * yysize;
1660 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1661 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1662 if (yymsg != yymsgbuf)
1663 YYSTACK_FREE (yymsg);
1664 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1666 yymsg_alloc = yyalloc;
1670 yymsg_alloc = sizeof yymsgbuf;
1674 if (0 < yysize && yysize <= yymsg_alloc)
1676 (void) yysyntax_error (yymsg, yystate, yychar);
1681 yyerror (YY_("syntax error"));
1683 goto yyexhaustedlab;
1691 if (yyerrstatus == 3)
1693 /* If just tried and failed to reuse look-ahead token after an
1694 error, discard it. */
1696 if (yychar <= YYEOF)
1698 /* Return failure if at end of input. */
1699 if (yychar == YYEOF)
1704 yydestruct ("Error: discarding",
1710 /* Else will try to reuse look-ahead token after shifting the error
1715 /*---------------------------------------------------.
1716 | yyerrorlab -- error raised explicitly by YYERROR. |
1717 `---------------------------------------------------*/
1720 /* Pacify compilers like GCC when the user code never invokes
1721 YYERROR and the label yyerrorlab therefore never appears in user
1723 if (/*CONSTCOND*/ 0)
1726 /* Do not reclaim the symbols of the rule which action triggered
1730 YY_STACK_PRINT (yyss, yyssp);
1735 /*-------------------------------------------------------------.
1736 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1737 `-------------------------------------------------------------*/
1739 yyerrstatus = 3; /* Each real token shifted decrements this. */
1743 yyn = yypact[yystate];
1744 if (yyn != YYPACT_NINF)
1747 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1755 /* Pop the current state because it cannot handle the error token. */
1760 yydestruct ("Error: popping",
1761 yystos[yystate], yyvsp);
1764 YY_STACK_PRINT (yyss, yyssp);
1773 /* Shift the error token. */
1774 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1780 /*-------------------------------------.
1781 | yyacceptlab -- YYACCEPT comes here. |
1782 `-------------------------------------*/
1787 /*-----------------------------------.
1788 | yyabortlab -- YYABORT comes here. |
1789 `-----------------------------------*/
1795 /*-------------------------------------------------.
1796 | yyexhaustedlab -- memory exhaustion comes here. |
1797 `-------------------------------------------------*/
1799 yyerror (YY_("memory exhausted"));
1805 if (yychar != YYEOF && yychar != YYEMPTY)
1806 yydestruct ("Cleanup: discarding lookahead",
1808 /* Do not reclaim the symbols of the rule which action triggered
1809 this YYABORT or YYACCEPT. */
1811 YY_STACK_PRINT (yyss, yyssp);
1812 while (yyssp != yyss)
1814 yydestruct ("Cleanup: popping",
1815 yystos[*yyssp], yyvsp);
1820 YYSTACK_FREE (yyss);
1823 if (yymsg != yymsgbuf)
1824 YYSTACK_FREE (yymsg);
1826 /* Make sure YYID is used. */
1827 return YYID (yyresult);
1831 #line 174 "uparse.y"