1 /* A Bison parser, made by GNU Bison 2.0. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 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., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, 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 YYSKELETON_NAME "yacc.c"
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
116 /* Copy the first part of user declarations. */
120 #include "amrecover.h"
122 void yyerror P((char *s));
123 extern int yylex P((void));
126 /* Enabling traces. */
131 /* Enabling verbose error messages. */
132 #ifdef YYERROR_VERBOSE
133 # undef YYERROR_VERBOSE
134 # define YYERROR_VERBOSE 1
136 # define YYERROR_VERBOSE 0
139 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
141 typedef union YYSTYPE {
147 /* Line 190 of yacc.c. */
149 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
150 # define YYSTYPE_IS_DECLARED 1
151 # define YYSTYPE_IS_TRIVIAL 1
156 /* Copy the second part of user declarations. */
159 /* Line 213 of yacc.c. */
162 #if ! defined (yyoverflow) || YYERROR_VERBOSE
168 # define YYMALLOC malloc
171 /* The parser invokes alloca or malloc; define the necessary symbols. */
173 # ifdef YYSTACK_USE_ALLOCA
174 # if YYSTACK_USE_ALLOCA
176 # define YYSTACK_ALLOC __builtin_alloca
178 # define YYSTACK_ALLOC alloca
183 # ifdef YYSTACK_ALLOC
184 /* Pacify GCC's `empty if-body' warning. */
185 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
187 # if defined (__STDC__) || defined (__cplusplus)
188 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
189 # define YYSIZE_T size_t
191 # define YYSTACK_ALLOC YYMALLOC
192 # define YYSTACK_FREE YYFREE
194 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
197 #if (! defined (yyoverflow) \
198 && (! defined (__cplusplus) \
199 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
201 /* A type that is properly aligned for any stack member. */
208 /* The size of the maximum gap between one aligned stack and the next. */
209 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
211 /* The size of an array large to enough to hold all stacks, each with
213 # define YYSTACK_BYTES(N) \
214 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
215 + YYSTACK_GAP_MAXIMUM)
217 /* Copy COUNT objects from FROM to TO. The source and destination do
220 # if defined (__GNUC__) && 1 < __GNUC__
221 # define YYCOPY(To, From, Count) \
222 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
224 # define YYCOPY(To, From, Count) \
227 register YYSIZE_T yyi; \
228 for (yyi = 0; yyi < (Count); yyi++) \
229 (To)[yyi] = (From)[yyi]; \
235 /* Relocate STACK from its old location to the new one. The
236 local variables YYSIZE and YYSTACKSIZE give the old and new number of
237 elements in the stack, and YYPTR gives the new location of the
238 stack. Advance YYPTR to a properly aligned location for the next
240 # define YYSTACK_RELOCATE(Stack) \
243 YYSIZE_T yynewbytes; \
244 YYCOPY (&yyptr->Stack, Stack, yysize); \
245 Stack = &yyptr->Stack; \
246 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
247 yyptr += yynewbytes / sizeof (*yyptr); \
253 #if defined (__STDC__) || defined (__cplusplus)
254 typedef signed char yysigned_char;
256 typedef short int yysigned_char;
259 /* YYFINAL -- State number of the termination state. */
261 /* YYLAST -- Last index in YYTABLE. */
264 /* YYNTOKENS -- Number of terminals. */
266 /* YYNNTS -- Number of nonterminals. */
268 /* YYNRULES -- Number of rules. */
270 /* YYNRULES -- Number of states. */
273 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
275 #define YYMAXUTOK 284
277 #define YYTRANSLATE(YYX) \
278 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
280 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
281 static const unsigned char yytranslate[] =
283 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
284 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
285 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
286 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
287 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
288 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
289 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
290 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
291 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
292 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
293 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
294 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
295 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
296 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
297 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
298 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
299 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
300 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
301 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
302 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
303 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
304 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
305 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
306 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
307 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
308 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
309 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
310 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
315 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
317 static const unsigned char yyprhs[] =
319 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
320 19, 21, 23, 26, 28, 31, 34, 38, 41, 44,
321 46, 49, 52, 55, 58, 60, 62, 65, 67, 69,
322 71, 73, 75, 78, 81, 83, 86, 89, 91, 94,
323 97, 99, 102, 105, 107, 109, 112, 114
326 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
327 static const yysigned_char yyrhs[] =
329 31, 0, -1, 32, -1, 33, -1, 34, -1, 35,
330 -1, 37, -1, 39, -1, 41, -1, 43, -1, 44,
331 -1, 45, -1, 3, 28, -1, 3, -1, 6, 29,
332 -1, 4, 28, -1, 5, 28, 28, -1, 5, 28,
333 -1, 7, 28, -1, 7, -1, 9, 28, -1, 10,
334 28, -1, 8, 26, -1, 8, 27, -1, 12, -1,
335 13, -1, 17, 28, -1, 17, -1, 20, -1, 21,
336 -1, 25, -1, 11, -1, 14, 36, -1, 36, 28,
337 -1, 28, -1, 15, 38, -1, 38, 28, -1, 28,
338 -1, 18, 40, -1, 40, 28, -1, 28, -1, 19,
339 42, -1, 42, 28, -1, 28, -1, 24, -1, 23,
340 28, -1, 22, -1, 16, -1
343 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
344 static const unsigned char yyrline[] =
346 0, 63, 63, 64, 65, 66, 67, 68, 69, 70,
347 71, 72, 76, 77, 78, 79, 80, 81, 82, 83,
348 84, 85, 86, 91, 99, 100, 101, 102, 103, 104,
349 105, 109, 113, 117, 118, 122, 126, 127, 131, 135,
350 136, 140, 144, 145, 149, 150, 159, 163
354 #if YYDEBUG || YYERROR_VERBOSE
355 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
356 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
357 static const char *const yytname[] =
359 "$end", "error", "$undefined", "LISTDISK", "SETHOST", "SETDISK",
360 "SETDATE", "SETTAPE", "SETMODE", "CD", "CDX", "QUIT", "DHIST", "LS",
361 "ADD", "ADDX", "EXTRACT", "LIST", "DELETE", "DELETEX", "PWD", "CLEAR",
362 "HELP", "LCD", "LPWD", "MODE", "SMB", "TAR", "PATH", "DATE", "$accept",
363 "ucommand", "set_command", "display_command", "quit_command",
364 "add_command", "add_path", "addx_command", "addx_path", "delete_command",
365 "delete_path", "deletex_command", "deletex_path", "local_command",
366 "help_command", "extract_command", 0
371 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
373 static const unsigned short int yytoknum[] =
375 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
376 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
377 275, 276, 277, 278, 279, 280, 281, 282, 283, 284
381 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
382 static const unsigned char yyr1[] =
384 0, 30, 31, 31, 31, 31, 31, 31, 31, 31,
385 31, 31, 32, 32, 32, 32, 32, 32, 32, 32,
386 32, 32, 32, 32, 33, 33, 33, 33, 33, 33,
387 33, 34, 35, 36, 36, 37, 38, 38, 39, 40,
388 40, 41, 42, 42, 43, 43, 44, 45
391 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
392 static const unsigned char yyr2[] =
394 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 2, 1, 2, 2, 3, 2, 2, 1,
396 2, 2, 2, 2, 1, 1, 2, 1, 1, 1,
397 1, 1, 2, 2, 1, 2, 2, 1, 2, 2,
398 1, 2, 2, 1, 1, 2, 1, 1
401 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
402 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
403 means the default is an error. */
404 static const unsigned char yydefact[] =
406 0, 13, 0, 0, 0, 19, 0, 0, 0, 31,
407 24, 25, 0, 0, 47, 27, 0, 0, 28, 29,
408 46, 0, 44, 30, 0, 2, 3, 4, 5, 6,
409 7, 8, 9, 10, 11, 12, 15, 17, 14, 18,
410 22, 23, 20, 21, 34, 32, 37, 35, 26, 40,
411 38, 43, 41, 45, 1, 16, 33, 36, 39, 42
414 /* YYDEFGOTO[NTERM-NUM]. */
415 static const yysigned_char yydefgoto[] =
417 -1, 24, 25, 26, 27, 28, 45, 29, 47, 30,
418 50, 31, 52, 32, 33, 34
421 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
423 #define YYPACT_NINF -6
424 static const yysigned_char yypact[] =
426 -3, -5, -1, 0, 1, 3, -2, 4, 5, -6,
427 -6, -6, 6, 7, -6, 8, 9, 10, -6, -6,
428 -6, 11, -6, -6, 26, -6, -6, -6, -6, -6,
429 -6, -6, -6, -6, -6, -6, -6, 12, -6, -6,
430 -6, -6, -6, -6, -6, 13, -6, 14, -6, -6,
431 15, -6, 16, -6, -6, -6, -6, -6, -6, -6
434 /* YYPGOTO[NTERM-NUM]. */
435 static const yysigned_char yypgoto[] =
437 -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
438 -6, -6, -6, -6, -6, -6
441 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
442 positive, shift that token. If negative, reduce the rule which
443 number is the opposite. If zero, do what YYDEFACT says.
444 If YYTABLE_NINF, syntax error. */
445 #define YYTABLE_NINF -1
446 static const unsigned char yytable[] =
448 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
449 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
450 21, 22, 23, 35, 40, 41, 54, 36, 37, 0,
451 38, 39, 42, 43, 44, 46, 48, 49, 51, 53,
455 static const yysigned_char yycheck[] =
457 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
458 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
459 23, 24, 25, 28, 26, 27, 0, 28, 28, -1,
460 29, 28, 28, 28, 28, 28, 28, 28, 28, 28,
464 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
465 symbol of state STATE-NUM. */
466 static const unsigned char yystos[] =
468 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
469 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
470 22, 23, 24, 25, 31, 32, 33, 34, 35, 37,
471 39, 41, 43, 44, 45, 28, 28, 28, 29, 28,
472 26, 27, 28, 28, 28, 36, 28, 38, 28, 28,
473 40, 28, 42, 28, 0, 28, 28, 28, 28, 28
476 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
477 # define YYSIZE_T __SIZE_TYPE__
479 #if ! defined (YYSIZE_T) && defined (size_t)
480 # define YYSIZE_T size_t
482 #if ! defined (YYSIZE_T)
483 # if defined (__STDC__) || defined (__cplusplus)
484 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
485 # define YYSIZE_T size_t
488 #if ! defined (YYSIZE_T)
489 # define YYSIZE_T unsigned int
492 #define yyerrok (yyerrstatus = 0)
493 #define yyclearin (yychar = YYEMPTY)
497 #define YYACCEPT goto yyacceptlab
498 #define YYABORT goto yyabortlab
499 #define YYERROR goto yyerrorlab
502 /* Like YYERROR except do call yyerror. This remains here temporarily
503 to ease the transition to the new meaning of YYERROR, for GCC.
504 Once GCC version 2 has supplanted version 1, this can go. */
506 #define YYFAIL goto yyerrlab
508 #define YYRECOVERING() (!!yyerrstatus)
510 #define YYBACKUP(Token, Value) \
512 if (yychar == YYEMPTY && yylen == 1) \
516 yytoken = YYTRANSLATE (yychar); \
522 yyerror ("syntax error: cannot back up");\
529 #define YYERRCODE 256
532 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
533 If N is 0, then set CURRENT to the empty location which ends
534 the previous symbol: RHS[0] (always defined). */
536 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
537 #ifndef YYLLOC_DEFAULT
538 # define YYLLOC_DEFAULT(Current, Rhs, N) \
542 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
543 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
544 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
545 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
549 (Current).first_line = (Current).last_line = \
550 YYRHSLOC (Rhs, 0).last_line; \
551 (Current).first_column = (Current).last_column = \
552 YYRHSLOC (Rhs, 0).last_column; \
558 /* YY_LOCATION_PRINT -- Print the location on the stream.
559 This macro was not mandated originally: define only if we know
560 we won't break user code: when these are the locations we know. */
562 #ifndef YY_LOCATION_PRINT
563 # if YYLTYPE_IS_TRIVIAL
564 # define YY_LOCATION_PRINT(File, Loc) \
565 fprintf (File, "%d.%d-%d.%d", \
566 (Loc).first_line, (Loc).first_column, \
567 (Loc).last_line, (Loc).last_column)
569 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
574 /* YYLEX -- calling `yylex' with the right arguments. */
577 # define YYLEX yylex (YYLEX_PARAM)
579 # define YYLEX yylex ()
582 /* Enable debugging if requested. */
586 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
587 # define YYFPRINTF fprintf
590 # define YYDPRINTF(Args) \
596 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
600 YYFPRINTF (stderr, "%s ", Title); \
601 yysymprint (stderr, \
603 YYFPRINTF (stderr, "\n"); \
607 /*------------------------------------------------------------------.
608 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
610 `------------------------------------------------------------------*/
612 #if defined (__STDC__) || defined (__cplusplus)
614 yy_stack_print (short int *bottom, short int *top)
617 yy_stack_print (bottom, top)
622 YYFPRINTF (stderr, "Stack now");
623 for (/* Nothing. */; bottom <= top; ++bottom)
624 YYFPRINTF (stderr, " %d", *bottom);
625 YYFPRINTF (stderr, "\n");
628 # define YY_STACK_PRINT(Bottom, Top) \
631 yy_stack_print ((Bottom), (Top)); \
635 /*------------------------------------------------.
636 | Report that the YYRULE is going to be reduced. |
637 `------------------------------------------------*/
639 #if defined (__STDC__) || defined (__cplusplus)
641 yy_reduce_print (int yyrule)
644 yy_reduce_print (yyrule)
649 unsigned int yylno = yyrline[yyrule];
650 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
652 /* Print the symbols being reduced, and their result. */
653 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
654 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
655 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
658 # define YY_REDUCE_PRINT(Rule) \
661 yy_reduce_print (Rule); \
664 /* Nonzero means print parse trace. It is left uninitialized so that
665 multiple parsers can coexist. */
668 # define YYDPRINTF(Args)
669 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
670 # define YY_STACK_PRINT(Bottom, Top)
671 # define YY_REDUCE_PRINT(Rule)
672 #endif /* !YYDEBUG */
675 /* YYINITDEPTH -- initial size of the parser's stacks. */
677 # define YYINITDEPTH 200
680 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
681 if the built-in stack extension method is used).
683 Do not make this value too large; the results are undefined if
684 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
685 evaluated with infinite-precision integer arithmetic. */
688 # define YYMAXDEPTH 10000
696 # if defined (__GLIBC__) && defined (_STRING_H)
697 # define yystrlen strlen
699 /* Return the length of YYSTR. */
701 # if defined (__STDC__) || defined (__cplusplus)
702 yystrlen (const char *yystr)
708 register const char *yys = yystr;
710 while (*yys++ != '\0')
713 return yys - yystr - 1;
719 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
720 # define yystpcpy stpcpy
722 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
725 # if defined (__STDC__) || defined (__cplusplus)
726 yystpcpy (char *yydest, const char *yysrc)
728 yystpcpy (yydest, yysrc)
733 register char *yyd = yydest;
734 register const char *yys = yysrc;
736 while ((*yyd++ = *yys++) != '\0')
744 #endif /* !YYERROR_VERBOSE */
749 /*--------------------------------.
750 | Print this symbol on YYOUTPUT. |
751 `--------------------------------*/
753 #if defined (__STDC__) || defined (__cplusplus)
755 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
758 yysymprint (yyoutput, yytype, yyvaluep)
764 /* Pacify ``unused variable'' warnings. */
767 if (yytype < YYNTOKENS)
768 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
770 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
774 if (yytype < YYNTOKENS)
775 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
782 YYFPRINTF (yyoutput, ")");
785 #endif /* ! YYDEBUG */
786 /*-----------------------------------------------.
787 | Release the memory associated to this symbol. |
788 `-----------------------------------------------*/
790 #if defined (__STDC__) || defined (__cplusplus)
792 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
795 yydestruct (yymsg, yytype, yyvaluep)
801 /* Pacify ``unused variable'' warnings. */
806 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
817 /* Prevent warnings from -Wmissing-prototypes. */
820 # if defined (__STDC__) || defined (__cplusplus)
821 int yyparse (void *YYPARSE_PARAM);
825 #else /* ! YYPARSE_PARAM */
826 #if defined (__STDC__) || defined (__cplusplus)
831 #endif /* ! YYPARSE_PARAM */
835 /* The look-ahead symbol. */
838 /* The semantic value of the look-ahead symbol. */
841 /* Number of syntax errors so far. */
851 # if defined (__STDC__) || defined (__cplusplus)
852 int yyparse (void *YYPARSE_PARAM)
854 int yyparse (YYPARSE_PARAM)
857 #else /* ! YYPARSE_PARAM */
858 #if defined (__STDC__) || defined (__cplusplus)
869 register int yystate;
872 /* Number of tokens to shift before error messages enabled. */
874 /* Look-ahead token as an internal (translated) token number. */
877 /* Three stacks and their tools:
878 `yyss': related to states,
879 `yyvs': related to semantic values,
880 `yyls': related to locations.
882 Refer to the stacks thru separate pointers, to allow yyoverflow
883 to reallocate them elsewhere. */
885 /* The state stack. */
886 short int yyssa[YYINITDEPTH];
887 short int *yyss = yyssa;
888 register short int *yyssp;
890 /* The semantic value stack. */
891 YYSTYPE yyvsa[YYINITDEPTH];
892 YYSTYPE *yyvs = yyvsa;
893 register YYSTYPE *yyvsp;
897 #define YYPOPSTACK (yyvsp--, yyssp--)
899 YYSIZE_T yystacksize = YYINITDEPTH;
901 /* The variables used to return semantic value and location from the
906 /* When reducing, the number of symbols on the RHS of the reduced
910 YYDPRINTF ((stderr, "Starting parse\n"));
915 yychar = YYEMPTY; /* Cause a token to be read. */
917 /* Initialize stack pointers.
918 Waste one element of value and location stack
919 so that they stay on the same level as the state stack.
920 The wasted elements are never initialized. */
930 /*------------------------------------------------------------.
931 | yynewstate -- Push a new state, which is found in yystate. |
932 `------------------------------------------------------------*/
934 /* In all cases, when you get here, the value and location stacks
935 have just been pushed. so pushing a state here evens the stacks.
942 if (yyss + yystacksize - 1 <= yyssp)
944 /* Get the current used size of the three stacks, in elements. */
945 YYSIZE_T yysize = yyssp - yyss + 1;
949 /* Give user a chance to reallocate the stack. Use copies of
950 these so that the &'s don't force the real ones into
952 YYSTYPE *yyvs1 = yyvs;
953 short int *yyss1 = yyss;
956 /* Each stack pointer address is followed by the size of the
957 data in use in that stack, in bytes. This used to be a
958 conditional around just the two extra args, but that might
959 be undefined if yyoverflow is a macro. */
960 yyoverflow ("parser stack overflow",
961 &yyss1, yysize * sizeof (*yyssp),
962 &yyvs1, yysize * sizeof (*yyvsp),
969 #else /* no yyoverflow */
970 # ifndef YYSTACK_RELOCATE
973 /* Extend the stack our own way. */
974 if (YYMAXDEPTH <= yystacksize)
977 if (YYMAXDEPTH < yystacksize)
978 yystacksize = YYMAXDEPTH;
981 short int *yyss1 = yyss;
982 union yyalloc *yyptr =
983 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
986 YYSTACK_RELOCATE (yyss);
987 YYSTACK_RELOCATE (yyvs);
989 # undef YYSTACK_RELOCATE
991 YYSTACK_FREE (yyss1);
994 #endif /* no yyoverflow */
996 yyssp = yyss + yysize - 1;
997 yyvsp = yyvs + yysize - 1;
1000 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1001 (unsigned long int) yystacksize));
1003 if (yyss + yystacksize - 1 <= yyssp)
1007 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1016 /* Do appropriate processing given the current state. */
1017 /* Read a look-ahead token if we need one and don't already have one. */
1020 /* First try to decide what to do without reference to look-ahead token. */
1022 yyn = yypact[yystate];
1023 if (yyn == YYPACT_NINF)
1026 /* Not known => get a look-ahead token if don't already have one. */
1028 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1029 if (yychar == YYEMPTY)
1031 YYDPRINTF ((stderr, "Reading a token: "));
1035 if (yychar <= YYEOF)
1037 yychar = yytoken = YYEOF;
1038 YYDPRINTF ((stderr, "Now at end of input.\n"));
1042 yytoken = YYTRANSLATE (yychar);
1043 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1046 /* If the proper action on seeing token YYTOKEN is to reduce or to
1047 detect an error, take that action. */
1049 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1054 if (yyn == 0 || yyn == YYTABLE_NINF)
1063 /* Shift the look-ahead token. */
1064 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1066 /* Discard the token being shifted unless it is eof. */
1067 if (yychar != YYEOF)
1073 /* Count tokens shifted since error; after three, turn off error
1082 /*-----------------------------------------------------------.
1083 | yydefault -- do the default action for the current state. |
1084 `-----------------------------------------------------------*/
1086 yyn = yydefact[yystate];
1092 /*-----------------------------.
1093 | yyreduce -- Do a reduction. |
1094 `-----------------------------*/
1096 /* yyn is the number of a rule to reduce with. */
1099 /* If YYLEN is nonzero, implement the default value of the action:
1102 Otherwise, the following line sets YYVAL to garbage.
1103 This behavior is undocumented and Bison
1104 users should not rely upon it. Assigning to YYVAL
1105 unconditionally makes the parser a bit smaller, and it avoids a
1106 GCC warning that YYVAL may be used uninitialized. */
1107 yyval = yyvsp[1-yylen];
1110 YY_REDUCE_PRINT (yyn);
1115 { list_disk((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1120 { list_disk(NULL); }
1125 { set_date((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1130 { set_host((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1135 { set_disk((yyvsp[-1].strval), (yyvsp[0].strval)); amfree((yyvsp[-1].strval)); amfree((yyvsp[0].strval)); }
1140 { set_disk((yyvsp[0].strval), NULL); amfree((yyvsp[0].strval)); }
1145 { set_tape((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1155 { cd_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1160 { cd_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1167 set_mode(SAMBA_SMBCLIENT);
1168 #endif /* SAMBA_CLIENT */
1176 set_mode(SAMBA_TAR);
1177 #endif /* SAMBA_CLIENT */
1183 { list_disk_history(); }
1187 #line 100 "uparse.y"
1188 { list_directory(); }
1192 #line 101 "uparse.y"
1193 { display_extract_list((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1197 #line 102 "uparse.y"
1198 { display_extract_list(NULL); }
1202 #line 103 "uparse.y"
1203 { show_directory(); }
1207 #line 104 "uparse.y"
1208 { clear_extract_list(); }
1212 #line 105 "uparse.y"
1217 #line 109 "uparse.y"
1222 #line 117 "uparse.y"
1223 { add_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1227 #line 118 "uparse.y"
1228 { add_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1232 #line 126 "uparse.y"
1233 { add_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1237 #line 127 "uparse.y"
1238 { add_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1242 #line 135 "uparse.y"
1243 { delete_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1247 #line 136 "uparse.y"
1248 { delete_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1252 #line 144 "uparse.y"
1253 { delete_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1257 #line 145 "uparse.y"
1258 { delete_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1262 #line 149 "uparse.y"
1263 { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); }
1267 #line 150 "uparse.y"
1269 if (chdir((yyvsp[0].strval)) == -1) {
1270 perror((yyvsp[0].strval));
1272 amfree((yyvsp[0].strval));
1277 #line 159 "uparse.y"
1282 #line 163 "uparse.y"
1283 { extract_files(); }
1289 /* Line 1037 of yacc.c. */
1290 #line 1291 "uparse.c"
1296 YY_STACK_PRINT (yyss, yyssp);
1301 /* Now `shift' the result of the reduction. Determine what state
1302 that goes to, based on the state we popped back to and the rule
1303 number reduced by. */
1307 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1308 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1309 yystate = yytable[yystate];
1311 yystate = yydefgoto[yyn - YYNTOKENS];
1316 /*------------------------------------.
1317 | yyerrlab -- here on detecting error |
1318 `------------------------------------*/
1320 /* If not already recovering from an error, report this error. */
1325 yyn = yypact[yystate];
1327 if (YYPACT_NINF < yyn && yyn < YYLAST)
1329 YYSIZE_T yysize = 0;
1330 int yytype = YYTRANSLATE (yychar);
1331 const char* yyprefix;
1335 /* Start YYX at -YYN if negative to avoid negative indexes in
1337 int yyxbegin = yyn < 0 ? -yyn : 0;
1339 /* Stay within bounds of both yycheck and yytname. */
1340 int yychecklim = YYLAST - yyn;
1341 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1344 yyprefix = ", expecting ";
1345 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1346 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1348 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
1356 yysize += (sizeof ("syntax error, unexpected ")
1357 + yystrlen (yytname[yytype]));
1358 yymsg = (char *) YYSTACK_ALLOC (yysize);
1361 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1362 yyp = yystpcpy (yyp, yytname[yytype]);
1366 yyprefix = ", expecting ";
1367 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1368 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1370 yyp = yystpcpy (yyp, yyprefix);
1371 yyp = yystpcpy (yyp, yytname[yyx]);
1376 YYSTACK_FREE (yymsg);
1379 yyerror ("syntax error; also virtual memory exhausted");
1382 #endif /* YYERROR_VERBOSE */
1383 yyerror ("syntax error");
1388 if (yyerrstatus == 3)
1390 /* If just tried and failed to reuse look-ahead token after an
1391 error, discard it. */
1393 if (yychar <= YYEOF)
1395 /* If at end of input, pop the error token,
1396 then the rest of the stack, then return failure. */
1397 if (yychar == YYEOF)
1404 yydestruct ("Error: popping",
1405 yystos[*yyssp], yyvsp);
1410 yydestruct ("Error: discarding", yytoken, &yylval);
1415 /* Else will try to reuse look-ahead token after shifting the error
1420 /*---------------------------------------------------.
1421 | yyerrorlab -- error raised explicitly by YYERROR. |
1422 `---------------------------------------------------*/
1426 /* Pacify GCC when the user code never invokes YYERROR and the label
1427 yyerrorlab therefore never appears in user code. */
1438 /*-------------------------------------------------------------.
1439 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1440 `-------------------------------------------------------------*/
1442 yyerrstatus = 3; /* Each real token shifted decrements this. */
1446 yyn = yypact[yystate];
1447 if (yyn != YYPACT_NINF)
1450 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1458 /* Pop the current state because it cannot handle the error token. */
1463 yydestruct ("Error: popping", yystos[yystate], yyvsp);
1466 YY_STACK_PRINT (yyss, yyssp);
1475 /* Shift the error token. */
1476 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1482 /*-------------------------------------.
1483 | yyacceptlab -- YYACCEPT comes here. |
1484 `-------------------------------------*/
1489 /*-----------------------------------.
1490 | yyabortlab -- YYABORT comes here. |
1491 `-----------------------------------*/
1493 yydestruct ("Error: discarding lookahead",
1500 /*----------------------------------------------.
1501 | yyoverflowlab -- parser overflow comes here. |
1502 `----------------------------------------------*/
1504 yyerror ("parser stack overflow");
1512 YYSTACK_FREE (yyss);
1518 #line 167 "uparse.y"
1524 printf("Invalid command - %s\n", s);