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
109 #define SETDEVICE 265
136 /* Copy the first part of user declarations. */
140 #include "amrecover.h"
142 void yyerror(char *s);
143 extern int yylex(void);
144 extern char * yytext;
148 /* Enabling traces. */
153 /* Enabling verbose error messages. */
154 #ifdef YYERROR_VERBOSE
155 # undef YYERROR_VERBOSE
156 # define YYERROR_VERBOSE 1
158 # define YYERROR_VERBOSE 0
161 /* Enabling the token table. */
162 #ifndef YYTOKEN_TABLE
163 # define YYTOKEN_TABLE 0
166 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
167 typedef union YYSTYPE
175 /* Line 187 of yacc.c. */
178 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
179 # define YYSTYPE_IS_DECLARED 1
180 # define YYSTYPE_IS_TRIVIAL 1
185 /* Copy the second part of user declarations. */
188 /* Line 216 of yacc.c. */
196 typedef YYTYPE_UINT8 yytype_uint8;
198 typedef unsigned char yytype_uint8;
202 typedef YYTYPE_INT8 yytype_int8;
203 #elif (defined __STDC__ || defined __C99__FUNC__ \
204 || defined __cplusplus || defined _MSC_VER)
205 typedef signed char yytype_int8;
207 typedef short int yytype_int8;
211 typedef YYTYPE_UINT16 yytype_uint16;
213 typedef unsigned short int yytype_uint16;
217 typedef YYTYPE_INT16 yytype_int16;
219 typedef short int yytype_int16;
223 # ifdef __SIZE_TYPE__
224 # define YYSIZE_T __SIZE_TYPE__
225 # elif defined size_t
226 # define YYSIZE_T size_t
227 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
228 || defined __cplusplus || defined _MSC_VER)
229 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
230 # define YYSIZE_T size_t
232 # define YYSIZE_T unsigned int
236 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
241 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
242 # define YY_(msgid) dgettext ("bison-runtime", msgid)
246 # define YY_(msgid) msgid
250 /* Suppress unused-variable warnings by "using" E. */
251 #if ! defined lint || defined __GNUC__
252 # define YYUSE(e) ((void) (e))
254 # define YYUSE(e) /* empty */
257 /* Identity function, used to suppress warnings about constant conditions. */
261 #if (defined __STDC__ || defined __C99__FUNC__ \
262 || defined __cplusplus || defined _MSC_VER)
275 #if ! defined yyoverflow || YYERROR_VERBOSE
277 /* The parser invokes alloca or malloc; define the necessary symbols. */
279 # ifdef YYSTACK_USE_ALLOCA
280 # if YYSTACK_USE_ALLOCA
282 # define YYSTACK_ALLOC __builtin_alloca
283 # elif defined __BUILTIN_VA_ARG_INCR
284 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
286 # define YYSTACK_ALLOC __alloca
287 # elif defined _MSC_VER
288 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
289 # define alloca _alloca
291 # define YYSTACK_ALLOC alloca
292 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
293 || defined __cplusplus || defined _MSC_VER)
294 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
303 # ifdef YYSTACK_ALLOC
304 /* Pacify GCC's `empty if-body' warning. */
305 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
306 # ifndef YYSTACK_ALLOC_MAXIMUM
307 /* The OS might guarantee only one guard page at the bottom of the stack,
308 and a page size can be as small as 4096 bytes. So we cannot safely
309 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
310 to allow for a few compiler-allocated temporary stack slots. */
311 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
314 # define YYSTACK_ALLOC YYMALLOC
315 # define YYSTACK_FREE YYFREE
316 # ifndef YYSTACK_ALLOC_MAXIMUM
317 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
319 # if (defined __cplusplus && ! defined _STDLIB_H \
320 && ! ((defined YYMALLOC || defined malloc) \
321 && (defined YYFREE || defined free)))
322 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
328 # define YYMALLOC malloc
329 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
330 || defined __cplusplus || defined _MSC_VER)
331 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
336 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
337 || defined __cplusplus || defined _MSC_VER)
338 void free (void *); /* INFRINGES ON USER NAME SPACE */
342 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
345 #if (! defined yyoverflow \
346 && (! defined __cplusplus \
347 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
349 /* A type that is properly aligned for any stack member. */
356 /* The size of the maximum gap between one aligned stack and the next. */
357 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
359 /* The size of an array large to enough to hold all stacks, each with
361 # define YYSTACK_BYTES(N) \
362 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
363 + YYSTACK_GAP_MAXIMUM)
365 /* Copy COUNT objects from FROM to TO. The source and destination do
368 # if defined __GNUC__ && 1 < __GNUC__
369 # define YYCOPY(To, From, Count) \
370 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
372 # define YYCOPY(To, From, Count) \
376 for (yyi = 0; yyi < (Count); yyi++) \
377 (To)[yyi] = (From)[yyi]; \
383 /* Relocate STACK from its old location to the new one. The
384 local variables YYSIZE and YYSTACKSIZE give the old and new number of
385 elements in the stack, and YYPTR gives the new location of the
386 stack. Advance YYPTR to a properly aligned location for the next
388 # define YYSTACK_RELOCATE(Stack) \
391 YYSIZE_T yynewbytes; \
392 YYCOPY (&yyptr->Stack, Stack, yysize); \
393 Stack = &yyptr->Stack; \
394 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
395 yyptr += yynewbytes / sizeof (*yyptr); \
401 /* YYFINAL -- State number of the termination state. */
403 /* YYLAST -- Last index in YYTABLE. */
406 /* YYNTOKENS -- Number of terminals. */
408 /* YYNNTS -- Number of nonterminals. */
410 /* YYNRULES -- Number of rules. */
412 /* YYNRULES -- Number of states. */
415 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
417 #define YYMAXUTOK 287
419 #define YYTRANSLATE(YYX) \
420 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
422 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
423 static const yytype_uint8 yytranslate[] =
425 0, 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, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
451 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
452 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
453 25, 26, 27, 28, 29, 30, 31, 32
457 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
459 static const yytype_uint8 yyprhs[] =
461 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
462 19, 21, 23, 24, 26, 29, 31, 34, 37, 41,
463 44, 47, 49, 52, 57, 59, 62, 65, 68, 71,
464 73, 75, 78, 80, 82, 84, 86, 88, 91, 94,
465 96, 99, 102, 104, 107, 110, 112, 115, 118, 120,
469 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
470 static const yytype_int8 yyrhs[] =
472 34, 0, -1, 35, -1, 36, -1, 37, -1, 38,
473 -1, 40, -1, 42, -1, 44, -1, 46, -1, 47,
474 -1, 48, -1, -1, 3, -1, 4, 31, -1, 4,
475 -1, 7, 32, -1, 5, 31, -1, 6, 31, 31,
476 -1, 6, 31, -1, 8, 31, -1, 8, -1, 10,
477 31, -1, 10, 19, 31, 31, -1, 10, -1, 11,
478 31, -1, 12, 31, -1, 9, 29, -1, 9, 30,
479 -1, 14, -1, 15, -1, 20, 31, -1, 20, -1,
480 23, -1, 24, -1, 28, -1, 13, -1, 16, 39,
481 -1, 39, 31, -1, 31, -1, 17, 41, -1, 41,
482 31, -1, 31, -1, 21, 43, -1, 43, 31, -1,
483 31, -1, 22, 45, -1, 45, 31, -1, 31, -1,
484 27, -1, 26, 31, -1, 25, -1, 18, -1
487 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
488 static const yytype_uint8 yyrline[] =
490 0, 65, 65, 66, 67, 68, 69, 70, 71, 72,
491 73, 74, 75, 84, 85, 86, 87, 88, 89, 90,
492 91, 92, 93, 94, 95, 96, 97, 98, 103, 111,
493 112, 113, 114, 115, 116, 117, 121, 125, 129, 130,
494 134, 138, 139, 143, 147, 148, 152, 156, 157, 161,
499 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
500 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
501 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
502 static const char *const yytname[] =
504 "$end", "error", "$undefined", "LISTHOST", "LISTDISK", "SETHOST",
505 "SETDISK", "SETDATE", "SETTAPE", "SETMODE", "SETDEVICE", "CD", "CDX",
506 "QUIT", "DHIST", "LS", "ADD", "ADDX", "EXTRACT", "DASH_H", "LIST",
507 "DELETE", "DELETEX", "PWD", "CLEAR", "HELP", "LCD", "LPWD", "MODE",
508 "SMB", "TAR", "PATH", "DATE", "$accept", "ucommand", "set_command",
509 "display_command", "quit_command", "add_command", "add_path",
510 "addx_command", "addx_path", "delete_command", "delete_path",
511 "deletex_command", "deletex_path", "local_command", "help_command",
517 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
519 static const yytype_uint16 yytoknum[] =
521 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
522 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
523 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
528 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
529 static const yytype_uint8 yyr1[] =
531 0, 33, 34, 34, 34, 34, 34, 34, 34, 34,
532 34, 34, 34, 35, 35, 35, 35, 35, 35, 35,
533 35, 35, 35, 35, 35, 35, 35, 35, 35, 36,
534 36, 36, 36, 36, 36, 36, 37, 38, 39, 39,
535 40, 41, 41, 42, 43, 43, 44, 45, 45, 46,
539 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
540 static const yytype_uint8 yyr2[] =
542 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
543 1, 1, 0, 1, 2, 1, 2, 2, 3, 2,
544 2, 1, 2, 4, 1, 2, 2, 2, 2, 1,
545 1, 2, 1, 1, 1, 1, 1, 2, 2, 1,
546 2, 2, 1, 2, 2, 1, 2, 2, 1, 1,
550 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
551 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
552 means the default is an error. */
553 static const yytype_uint8 yydefact[] =
555 12, 13, 15, 0, 0, 0, 21, 0, 24, 0,
556 0, 36, 29, 30, 0, 0, 52, 32, 0, 0,
557 33, 34, 51, 0, 49, 35, 0, 2, 3, 4,
558 5, 6, 7, 8, 9, 10, 11, 14, 17, 19,
559 16, 20, 27, 28, 0, 22, 25, 26, 39, 37,
560 42, 40, 31, 45, 43, 48, 46, 50, 1, 18,
561 0, 38, 41, 44, 47, 23
564 /* YYDEFGOTO[NTERM-NUM]. */
565 static const yytype_int8 yydefgoto[] =
567 -1, 26, 27, 28, 29, 30, 49, 31, 51, 32,
568 54, 33, 56, 34, 35, 36
571 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
573 #define YYPACT_NINF -16
574 static const yytype_int8 yypact[] =
576 -3, -16, -15, -1, 0, 1, 3, -2, 7, 4,
577 5, -16, -16, -16, 6, 8, -16, 9, 10, 11,
578 -16, -16, -16, 12, -16, -16, 29, -16, -16, -16,
579 -16, -16, -16, -16, -16, -16, -16, -16, -16, 13,
580 -16, -16, -16, -16, 14, -16, -16, -16, -16, 15,
581 -16, 16, -16, -16, 17, -16, 18, -16, -16, -16,
582 19, -16, -16, -16, -16, -16
585 /* YYPGOTO[NTERM-NUM]. */
586 static const yytype_int8 yypgoto[] =
588 -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
589 -16, -16, -16, -16, -16, -16
592 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
593 positive, shift that token. If negative, reduce the rule which
594 number is the opposite. If zero, do what YYDEFACT says.
595 If YYTABLE_NINF, syntax error. */
596 #define YYTABLE_NINF -1
597 static const yytype_uint8 yytable[] =
599 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
600 11, 12, 13, 14, 15, 16, 37, 17, 18, 19,
601 20, 21, 22, 23, 24, 25, 44, 42, 43, 58,
602 38, 39, 0, 40, 41, 46, 47, 48, 45, 50,
603 52, 53, 55, 57, 59, 60, 61, 62, 63, 64,
607 static const yytype_int8 yycheck[] =
609 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
610 13, 14, 15, 16, 17, 18, 31, 20, 21, 22,
611 23, 24, 25, 26, 27, 28, 19, 29, 30, 0,
612 31, 31, -1, 32, 31, 31, 31, 31, 31, 31,
613 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
617 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
618 symbol of state STATE-NUM. */
619 static const yytype_uint8 yystos[] =
621 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
622 12, 13, 14, 15, 16, 17, 18, 20, 21, 22,
623 23, 24, 25, 26, 27, 28, 34, 35, 36, 37,
624 38, 40, 42, 44, 46, 47, 48, 31, 31, 31,
625 32, 31, 29, 30, 19, 31, 31, 31, 31, 39,
626 31, 41, 31, 31, 43, 31, 45, 31, 0, 31,
627 31, 31, 31, 31, 31, 31
630 #define yyerrok (yyerrstatus = 0)
631 #define yyclearin (yychar = YYEMPTY)
635 #define YYACCEPT goto yyacceptlab
636 #define YYABORT goto yyabortlab
637 #define YYERROR goto yyerrorlab
640 /* Like YYERROR except do call yyerror. This remains here temporarily
641 to ease the transition to the new meaning of YYERROR, for GCC.
642 Once GCC version 2 has supplanted version 1, this can go. */
644 #define YYFAIL goto yyerrlab
646 #define YYRECOVERING() (!!yyerrstatus)
648 #define YYBACKUP(Token, Value) \
650 if (yychar == YYEMPTY && yylen == 1) \
654 yytoken = YYTRANSLATE (yychar); \
660 yyerror (YY_("syntax error: cannot back up")); \
667 #define YYERRCODE 256
670 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
671 If N is 0, then set CURRENT to the empty location which ends
672 the previous symbol: RHS[0] (always defined). */
674 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
675 #ifndef YYLLOC_DEFAULT
676 # define YYLLOC_DEFAULT(Current, Rhs, N) \
680 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
681 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
682 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
683 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
687 (Current).first_line = (Current).last_line = \
688 YYRHSLOC (Rhs, 0).last_line; \
689 (Current).first_column = (Current).last_column = \
690 YYRHSLOC (Rhs, 0).last_column; \
696 /* YY_LOCATION_PRINT -- Print the location on the stream.
697 This macro was not mandated originally: define only if we know
698 we won't break user code: when these are the locations we know. */
700 #ifndef YY_LOCATION_PRINT
701 # if YYLTYPE_IS_TRIVIAL
702 # define YY_LOCATION_PRINT(File, Loc) \
703 fprintf (File, "%d.%d-%d.%d", \
704 (Loc).first_line, (Loc).first_column, \
705 (Loc).last_line, (Loc).last_column)
707 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
712 /* YYLEX -- calling `yylex' with the right arguments. */
715 # define YYLEX yylex (YYLEX_PARAM)
717 # define YYLEX yylex ()
720 /* Enable debugging if requested. */
724 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
725 # define YYFPRINTF fprintf
728 # define YYDPRINTF(Args) \
734 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
738 YYFPRINTF (stderr, "%s ", Title); \
739 yy_symbol_print (stderr, \
741 YYFPRINTF (stderr, "\n"); \
746 /*--------------------------------.
747 | Print this symbol on YYOUTPUT. |
748 `--------------------------------*/
751 #if (defined __STDC__ || defined __C99__FUNC__ \
752 || defined __cplusplus || defined _MSC_VER)
754 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
757 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
760 YYSTYPE const * const yyvaluep;
766 if (yytype < YYNTOKENS)
767 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
779 /*--------------------------------.
780 | Print this symbol on YYOUTPUT. |
781 `--------------------------------*/
783 #if (defined __STDC__ || defined __C99__FUNC__ \
784 || defined __cplusplus || defined _MSC_VER)
786 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
789 yy_symbol_print (yyoutput, yytype, yyvaluep)
792 YYSTYPE const * const yyvaluep;
795 if (yytype < YYNTOKENS)
796 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
798 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
800 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
801 YYFPRINTF (yyoutput, ")");
804 /*------------------------------------------------------------------.
805 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
807 `------------------------------------------------------------------*/
809 #if (defined __STDC__ || defined __C99__FUNC__ \
810 || defined __cplusplus || defined _MSC_VER)
812 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
815 yy_stack_print (bottom, top)
816 yytype_int16 *bottom;
820 YYFPRINTF (stderr, "Stack now");
821 for (; bottom <= top; ++bottom)
822 YYFPRINTF (stderr, " %d", *bottom);
823 YYFPRINTF (stderr, "\n");
826 # define YY_STACK_PRINT(Bottom, Top) \
829 yy_stack_print ((Bottom), (Top)); \
833 /*------------------------------------------------.
834 | Report that the YYRULE is going to be reduced. |
835 `------------------------------------------------*/
837 #if (defined __STDC__ || defined __C99__FUNC__ \
838 || defined __cplusplus || defined _MSC_VER)
840 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
843 yy_reduce_print (yyvsp, yyrule)
848 int yynrhs = yyr2[yyrule];
850 unsigned long int yylno = yyrline[yyrule];
851 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
853 /* The symbols being reduced. */
854 for (yyi = 0; yyi < yynrhs; yyi++)
856 fprintf (stderr, " $%d = ", yyi + 1);
857 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
858 &(yyvsp[(yyi + 1) - (yynrhs)])
860 fprintf (stderr, "\n");
864 # define YY_REDUCE_PRINT(Rule) \
867 yy_reduce_print (yyvsp, Rule); \
870 /* Nonzero means print parse trace. It is left uninitialized so that
871 multiple parsers can coexist. */
874 # define YYDPRINTF(Args)
875 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
876 # define YY_STACK_PRINT(Bottom, Top)
877 # define YY_REDUCE_PRINT(Rule)
878 #endif /* !YYDEBUG */
881 /* YYINITDEPTH -- initial size of the parser's stacks. */
883 # define YYINITDEPTH 200
886 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
887 if the built-in stack extension method is used).
889 Do not make this value too large; the results are undefined if
890 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
891 evaluated with infinite-precision integer arithmetic. */
894 # define YYMAXDEPTH 10000
902 # if defined __GLIBC__ && defined _STRING_H
903 # define yystrlen strlen
905 /* Return the length of YYSTR. */
906 #if (defined __STDC__ || defined __C99__FUNC__ \
907 || defined __cplusplus || defined _MSC_VER)
909 yystrlen (const char *yystr)
917 for (yylen = 0; yystr[yylen]; yylen++)
925 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
926 # define yystpcpy stpcpy
928 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
930 #if (defined __STDC__ || defined __C99__FUNC__ \
931 || defined __cplusplus || defined _MSC_VER)
933 yystpcpy (char *yydest, const char *yysrc)
936 yystpcpy (yydest, yysrc)
942 const char *yys = yysrc;
944 while ((*yyd++ = *yys++) != '\0')
953 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
954 quotes and backslashes, so that it's suitable for yyerror. The
955 heuristic is that double-quoting is unnecessary unless the string
956 contains an apostrophe, a comma, or backslash (other than
957 backslash-backslash). YYSTR is taken from yytname. If YYRES is
958 null, do not copy; instead, return the length of what the result
961 yytnamerr (char *yyres, const char *yystr)
966 char const *yyp = yystr;
973 goto do_not_strip_quotes;
977 goto do_not_strip_quotes;
990 do_not_strip_quotes: ;
994 return yystrlen (yystr);
996 return yystpcpy (yyres, yystr) - yyres;
1000 /* Copy into YYRESULT an error message about the unexpected token
1001 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1002 including the terminating null byte. If YYRESULT is null, do not
1003 copy anything; just return the number of bytes that would be
1004 copied. As a special case, return 0 if an ordinary "syntax error"
1005 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1006 size calculation. */
1008 yysyntax_error (char *yyresult, int yystate, int yychar)
1010 int yyn = yypact[yystate];
1012 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1016 int yytype = YYTRANSLATE (yychar);
1017 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1018 YYSIZE_T yysize = yysize0;
1020 int yysize_overflow = 0;
1021 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1022 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1026 /* This is so xgettext sees the translatable formats that are
1027 constructed on the fly. */
1028 YY_("syntax error, unexpected %s");
1029 YY_("syntax error, unexpected %s, expecting %s");
1030 YY_("syntax error, unexpected %s, expecting %s or %s");
1031 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1032 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1036 static char const yyunexpected[] = "syntax error, unexpected %s";
1037 static char const yyexpecting[] = ", expecting %s";
1038 static char const yyor[] = " or %s";
1039 char yyformat[sizeof yyunexpected
1040 + sizeof yyexpecting - 1
1041 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1042 * (sizeof yyor - 1))];
1043 char const *yyprefix = yyexpecting;
1045 /* Start YYX at -YYN if negative to avoid negative indexes in
1047 int yyxbegin = yyn < 0 ? -yyn : 0;
1049 /* Stay within bounds of both yycheck and yytname. */
1050 int yychecklim = YYLAST - yyn + 1;
1051 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1054 yyarg[0] = yytname[yytype];
1055 yyfmt = yystpcpy (yyformat, yyunexpected);
1057 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1058 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1060 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1064 yyformat[sizeof yyunexpected - 1] = '\0';
1067 yyarg[yycount++] = yytname[yyx];
1068 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1069 yysize_overflow |= (yysize1 < yysize);
1071 yyfmt = yystpcpy (yyfmt, yyprefix);
1075 yyf = YY_(yyformat);
1076 yysize1 = yysize + yystrlen (yyf);
1077 yysize_overflow |= (yysize1 < yysize);
1080 if (yysize_overflow)
1081 return YYSIZE_MAXIMUM;
1085 /* Avoid sprintf, as that infringes on the user's name space.
1086 Don't have undefined behavior even if the translation
1087 produced a string with the wrong number of "%s"s. */
1088 char *yyp = yyresult;
1090 while ((*yyp = *yyf) != '\0')
1092 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1094 yyp += yytnamerr (yyp, yyarg[yyi++]);
1107 #endif /* YYERROR_VERBOSE */
1110 /*-----------------------------------------------.
1111 | Release the memory associated to this symbol. |
1112 `-----------------------------------------------*/
1115 #if (defined __STDC__ || defined __C99__FUNC__ \
1116 || defined __cplusplus || defined _MSC_VER)
1118 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1121 yydestruct (yymsg, yytype, yyvaluep)
1131 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1142 /* Prevent warnings from -Wmissing-prototypes. */
1144 #ifdef YYPARSE_PARAM
1145 #if defined __STDC__ || defined __cplusplus
1146 int yyparse (void *YYPARSE_PARAM);
1150 #else /* ! YYPARSE_PARAM */
1151 #if defined __STDC__ || defined __cplusplus
1156 #endif /* ! YYPARSE_PARAM */
1160 /* The look-ahead symbol. */
1163 /* The semantic value of the look-ahead symbol. */
1166 /* Number of syntax errors so far. */
1175 #ifdef YYPARSE_PARAM
1176 #if (defined __STDC__ || defined __C99__FUNC__ \
1177 || defined __cplusplus || defined _MSC_VER)
1179 yyparse (void *YYPARSE_PARAM)
1182 yyparse (YYPARSE_PARAM)
1183 void *YYPARSE_PARAM;
1185 #else /* ! YYPARSE_PARAM */
1186 #if (defined __STDC__ || defined __C99__FUNC__ \
1187 || defined __cplusplus || defined _MSC_VER)
1201 /* Number of tokens to shift before error messages enabled. */
1203 /* Look-ahead token as an internal (translated) token number. */
1206 /* Buffer for error messages, and its allocated size. */
1208 char *yymsg = yymsgbuf;
1209 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1212 /* Three stacks and their tools:
1213 `yyss': related to states,
1214 `yyvs': related to semantic values,
1215 `yyls': related to locations.
1217 Refer to the stacks thru separate pointers, to allow yyoverflow
1218 to reallocate them elsewhere. */
1220 /* The state stack. */
1221 yytype_int16 yyssa[YYINITDEPTH];
1222 yytype_int16 *yyss = yyssa;
1223 yytype_int16 *yyssp;
1225 /* The semantic value stack. */
1226 YYSTYPE yyvsa[YYINITDEPTH];
1227 YYSTYPE *yyvs = yyvsa;
1232 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1234 YYSIZE_T yystacksize = YYINITDEPTH;
1236 /* The variables used to return semantic value and location from the
1241 /* The number of symbols on the RHS of the reduced rule.
1242 Keep to zero when no symbol should be popped. */
1245 YYDPRINTF ((stderr, "Starting parse\n"));
1250 yychar = YYEMPTY; /* Cause a token to be read. */
1252 /* Initialize stack pointers.
1253 Waste one element of value and location stack
1254 so that they stay on the same level as the state stack.
1255 The wasted elements are never initialized. */
1262 /*------------------------------------------------------------.
1263 | yynewstate -- Push a new state, which is found in yystate. |
1264 `------------------------------------------------------------*/
1266 /* In all cases, when you get here, the value and location stacks
1267 have just been pushed. So pushing a state here evens the stacks. */
1273 if (yyss + yystacksize - 1 <= yyssp)
1275 /* Get the current used size of the three stacks, in elements. */
1276 YYSIZE_T yysize = yyssp - yyss + 1;
1280 /* Give user a chance to reallocate the stack. Use copies of
1281 these so that the &'s don't force the real ones into
1283 YYSTYPE *yyvs1 = yyvs;
1284 yytype_int16 *yyss1 = yyss;
1287 /* Each stack pointer address is followed by the size of the
1288 data in use in that stack, in bytes. This used to be a
1289 conditional around just the two extra args, but that might
1290 be undefined if yyoverflow is a macro. */
1291 yyoverflow (YY_("memory exhausted"),
1292 &yyss1, yysize * sizeof (*yyssp),
1293 &yyvs1, yysize * sizeof (*yyvsp),
1300 #else /* no yyoverflow */
1301 # ifndef YYSTACK_RELOCATE
1302 goto yyexhaustedlab;
1304 /* Extend the stack our own way. */
1305 if (YYMAXDEPTH <= yystacksize)
1306 goto yyexhaustedlab;
1308 if (YYMAXDEPTH < yystacksize)
1309 yystacksize = YYMAXDEPTH;
1312 yytype_int16 *yyss1 = yyss;
1313 union yyalloc *yyptr =
1314 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1316 goto yyexhaustedlab;
1317 YYSTACK_RELOCATE (yyss);
1318 YYSTACK_RELOCATE (yyvs);
1320 # undef YYSTACK_RELOCATE
1322 YYSTACK_FREE (yyss1);
1325 #endif /* no yyoverflow */
1327 yyssp = yyss + yysize - 1;
1328 yyvsp = yyvs + yysize - 1;
1331 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1332 (unsigned long int) yystacksize));
1334 if (yyss + yystacksize - 1 <= yyssp)
1338 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1347 /* Do appropriate processing given the current state. Read a
1348 look-ahead token if we need one and don't already have one. */
1350 /* First try to decide what to do without reference to look-ahead token. */
1351 yyn = yypact[yystate];
1352 if (yyn == YYPACT_NINF)
1355 /* Not known => get a look-ahead token if don't already have one. */
1357 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1358 if (yychar == YYEMPTY)
1360 YYDPRINTF ((stderr, "Reading a token: "));
1364 if (yychar <= YYEOF)
1366 yychar = yytoken = YYEOF;
1367 YYDPRINTF ((stderr, "Now at end of input.\n"));
1371 yytoken = YYTRANSLATE (yychar);
1372 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1375 /* If the proper action on seeing token YYTOKEN is to reduce or to
1376 detect an error, take that action. */
1378 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1383 if (yyn == 0 || yyn == YYTABLE_NINF)
1392 /* Count tokens shifted since error; after three, turn off error
1397 /* Shift the look-ahead token. */
1398 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1400 /* Discard the shifted token unless it is eof. */
1401 if (yychar != YYEOF)
1410 /*-----------------------------------------------------------.
1411 | yydefault -- do the default action for the current state. |
1412 `-----------------------------------------------------------*/
1414 yyn = yydefact[yystate];
1420 /*-----------------------------.
1421 | yyreduce -- Do a reduction. |
1422 `-----------------------------*/
1424 /* yyn is the number of a rule to reduce with. */
1427 /* If YYLEN is nonzero, implement the default value of the action:
1430 Otherwise, the following line sets YYVAL to garbage.
1431 This behavior is undocumented and Bison
1432 users should not rely upon it. Assigning to YYVAL
1433 unconditionally makes the parser a bit smaller, and it avoids a
1434 GCC warning that YYVAL may be used uninitialized. */
1435 yyval = yyvsp[1-yylen];
1438 YY_REDUCE_PRINT (yyn);
1444 char * errstr = vstralloc("Invalid command: ", yytext, NULL);
1458 { list_disk((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1463 { list_disk(NULL); }
1468 { set_date((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1473 { set_host((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1478 { set_disk((yyvsp[(2) - (3)].strval), (yyvsp[(3) - (3)].strval)); amfree((yyvsp[(2) - (3)].strval)); amfree((yyvsp[(3) - (3)].strval)); }
1483 { set_disk((yyvsp[(2) - (2)].strval), NULL); amfree((yyvsp[(2) - (2)].strval)); }
1488 { set_tape((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1493 { set_tape("default"); }
1498 { set_device(NULL, (yyvsp[(2) - (2)].strval)); }
1503 { set_device((yyvsp[(3) - (4)].strval), (yyvsp[(4) - (4)].strval)); }
1508 { set_device(NULL, NULL); }
1513 { cd_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1518 { cd_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1525 set_mode(SAMBA_SMBCLIENT);
1526 #endif /* SAMBA_CLIENT */
1531 #line 103 "uparse.y"
1534 set_mode(SAMBA_TAR);
1535 #endif /* SAMBA_CLIENT */
1540 #line 111 "uparse.y"
1541 { list_disk_history(); }
1545 #line 112 "uparse.y"
1546 { list_directory(); }
1550 #line 113 "uparse.y"
1551 { display_extract_list((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1555 #line 114 "uparse.y"
1556 { display_extract_list(NULL); }
1560 #line 115 "uparse.y"
1561 { show_directory(); }
1565 #line 116 "uparse.y"
1566 { clear_extract_list(); }
1570 #line 117 "uparse.y"
1575 #line 121 "uparse.y"
1580 #line 129 "uparse.y"
1581 { add_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1585 #line 130 "uparse.y"
1586 { add_glob((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
1590 #line 138 "uparse.y"
1591 { add_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1595 #line 139 "uparse.y"
1596 { add_regex((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
1600 #line 147 "uparse.y"
1601 { delete_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1605 #line 148 "uparse.y"
1606 { delete_glob((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
1610 #line 156 "uparse.y"
1611 { delete_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
1615 #line 157 "uparse.y"
1616 { delete_regex((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
1620 #line 161 "uparse.y"
1621 { char * buf= g_get_current_dir(); puts(buf); free(buf); }
1625 #line 162 "uparse.y"
1627 local_cd((yyvsp[(2) - (2)].strval));
1628 amfree((yyvsp[(2) - (2)].strval));
1633 #line 169 "uparse.y"
1638 #line 173 "uparse.y"
1639 { extract_files(); }
1643 /* Line 1267 of yacc.c. */
1644 #line 1645 "uparse.c"
1647 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1651 YY_STACK_PRINT (yyss, yyssp);
1656 /* Now `shift' the result of the reduction. Determine what state
1657 that goes to, based on the state we popped back to and the rule
1658 number reduced by. */
1662 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1663 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1664 yystate = yytable[yystate];
1666 yystate = yydefgoto[yyn - YYNTOKENS];
1671 /*------------------------------------.
1672 | yyerrlab -- here on detecting error |
1673 `------------------------------------*/
1675 /* If not already recovering from an error, report this error. */
1679 #if ! YYERROR_VERBOSE
1680 yyerror (YY_("syntax error"));
1683 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1684 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1686 YYSIZE_T yyalloc = 2 * yysize;
1687 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1688 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1689 if (yymsg != yymsgbuf)
1690 YYSTACK_FREE (yymsg);
1691 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1693 yymsg_alloc = yyalloc;
1697 yymsg_alloc = sizeof yymsgbuf;
1701 if (0 < yysize && yysize <= yymsg_alloc)
1703 (void) yysyntax_error (yymsg, yystate, yychar);
1708 yyerror (YY_("syntax error"));
1710 goto yyexhaustedlab;
1718 if (yyerrstatus == 3)
1720 /* If just tried and failed to reuse look-ahead token after an
1721 error, discard it. */
1723 if (yychar <= YYEOF)
1725 /* Return failure if at end of input. */
1726 if (yychar == YYEOF)
1731 yydestruct ("Error: discarding",
1737 /* Else will try to reuse look-ahead token after shifting the error
1742 /*---------------------------------------------------.
1743 | yyerrorlab -- error raised explicitly by YYERROR. |
1744 `---------------------------------------------------*/
1747 /* Pacify compilers like GCC when the user code never invokes
1748 YYERROR and the label yyerrorlab therefore never appears in user
1750 if (/*CONSTCOND*/ 0)
1753 /* Do not reclaim the symbols of the rule which action triggered
1757 YY_STACK_PRINT (yyss, yyssp);
1762 /*-------------------------------------------------------------.
1763 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1764 `-------------------------------------------------------------*/
1766 yyerrstatus = 3; /* Each real token shifted decrements this. */
1770 yyn = yypact[yystate];
1771 if (yyn != YYPACT_NINF)
1774 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1782 /* Pop the current state because it cannot handle the error token. */
1787 yydestruct ("Error: popping",
1788 yystos[yystate], yyvsp);
1791 YY_STACK_PRINT (yyss, yyssp);
1800 /* Shift the error token. */
1801 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1807 /*-------------------------------------.
1808 | yyacceptlab -- YYACCEPT comes here. |
1809 `-------------------------------------*/
1814 /*-----------------------------------.
1815 | yyabortlab -- YYABORT comes here. |
1816 `-----------------------------------*/
1822 /*-------------------------------------------------.
1823 | yyexhaustedlab -- memory exhaustion comes here. |
1824 `-------------------------------------------------*/
1826 yyerror (YY_("memory exhausted"));
1832 if (yychar != YYEOF && yychar != YYEMPTY)
1833 yydestruct ("Cleanup: discarding lookahead",
1835 /* Do not reclaim the symbols of the rule which action triggered
1836 this YYABORT or YYACCEPT. */
1838 YY_STACK_PRINT (yyss, yyssp);
1839 while (yyssp != yyss)
1841 yydestruct ("Cleanup: popping",
1842 yystos[*yyssp], yyvsp);
1847 YYSTACK_FREE (yyss);
1850 if (yymsg != yymsgbuf)
1851 YYSTACK_FREE (yymsg);
1853 /* Make sure YYID is used. */
1854 return YYID (yyresult);
1858 #line 177 "uparse.y"
1865 g_printf("%s\n", s);