1 /* A Bison parser, made by GNU Bison 1.875c. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 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 191 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 214 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
175 # define YYSTACK_ALLOC alloca
178 # if defined (alloca) || defined (_ALLOCA_H)
179 # define YYSTACK_ALLOC alloca
182 # define YYSTACK_ALLOC __builtin_alloca
187 # ifdef YYSTACK_ALLOC
188 /* Pacify GCC's `empty if-body' warning. */
189 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
191 # if defined (__STDC__) || defined (__cplusplus)
192 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
193 # define YYSIZE_T size_t
195 # define YYSTACK_ALLOC YYMALLOC
196 # define YYSTACK_FREE YYFREE
198 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
201 #if (! defined (yyoverflow) \
202 && (! defined (__cplusplus) \
203 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
205 /* A type that is properly aligned for any stack member. */
212 /* The size of the maximum gap between one aligned stack and the next. */
213 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
215 /* The size of an array large to enough to hold all stacks, each with
217 # define YYSTACK_BYTES(N) \
218 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
219 + YYSTACK_GAP_MAXIMUM)
221 /* Copy COUNT objects from FROM to TO. The source and destination do
224 # if defined (__GNUC__) && 1 < __GNUC__
225 # define YYCOPY(To, From, Count) \
226 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
228 # define YYCOPY(To, From, Count) \
231 register YYSIZE_T yyi; \
232 for (yyi = 0; yyi < (Count); yyi++) \
233 (To)[yyi] = (From)[yyi]; \
239 /* Relocate STACK from its old location to the new one. The
240 local variables YYSIZE and YYSTACKSIZE give the old and new number of
241 elements in the stack, and YYPTR gives the new location of the
242 stack. Advance YYPTR to a properly aligned location for the next
244 # define YYSTACK_RELOCATE(Stack) \
247 YYSIZE_T yynewbytes; \
248 YYCOPY (&yyptr->Stack, Stack, yysize); \
249 Stack = &yyptr->Stack; \
250 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
251 yyptr += yynewbytes / sizeof (*yyptr); \
257 #if defined (__STDC__) || defined (__cplusplus)
258 typedef signed char yysigned_char;
260 typedef short yysigned_char;
263 /* YYFINAL -- State number of the termination state. */
265 /* YYLAST -- Last index in YYTABLE. */
268 /* YYNTOKENS -- Number of terminals. */
270 /* YYNNTS -- Number of nonterminals. */
272 /* YYNRULES -- Number of rules. */
274 /* YYNRULES -- Number of states. */
277 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
279 #define YYMAXUTOK 284
281 #define YYTRANSLATE(YYX) \
282 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
284 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
285 static const unsigned char yytranslate[] =
287 0, 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, 2, 2, 2, 2,
309 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
310 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
311 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
312 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
313 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
314 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
319 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
321 static const unsigned char yyprhs[] =
323 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
324 19, 21, 23, 26, 28, 31, 34, 38, 41, 44,
325 46, 49, 52, 55, 58, 60, 62, 65, 67, 69,
326 71, 73, 75, 78, 81, 83, 86, 89, 91, 94,
327 97, 99, 102, 105, 107, 109, 112, 114
330 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
331 static const yysigned_char yyrhs[] =
333 31, 0, -1, 32, -1, 33, -1, 34, -1, 35,
334 -1, 37, -1, 39, -1, 41, -1, 43, -1, 44,
335 -1, 45, -1, 3, 28, -1, 3, -1, 6, 29,
336 -1, 4, 28, -1, 5, 28, 28, -1, 5, 28,
337 -1, 7, 28, -1, 7, -1, 9, 28, -1, 10,
338 28, -1, 8, 26, -1, 8, 27, -1, 12, -1,
339 13, -1, 17, 28, -1, 17, -1, 20, -1, 21,
340 -1, 25, -1, 11, -1, 14, 36, -1, 36, 28,
341 -1, 28, -1, 15, 38, -1, 38, 28, -1, 28,
342 -1, 18, 40, -1, 40, 28, -1, 28, -1, 19,
343 42, -1, 42, 28, -1, 28, -1, 24, -1, 23,
344 28, -1, 22, -1, 16, -1
347 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
348 static const unsigned char yyrline[] =
350 0, 63, 63, 64, 65, 66, 67, 68, 69, 70,
351 71, 72, 76, 77, 78, 79, 80, 81, 82, 83,
352 84, 85, 86, 91, 99, 100, 101, 102, 103, 104,
353 105, 109, 113, 117, 118, 122, 126, 127, 131, 135,
354 136, 140, 144, 145, 149, 150, 159, 163
358 #if YYDEBUG || YYERROR_VERBOSE
359 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
360 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
361 static const char *const yytname[] =
363 "$end", "error", "$undefined", "LISTDISK", "SETHOST", "SETDISK",
364 "SETDATE", "SETTAPE", "SETMODE", "CD", "CDX", "QUIT", "DHIST", "LS",
365 "ADD", "ADDX", "EXTRACT", "LIST", "DELETE", "DELETEX", "PWD", "CLEAR",
366 "HELP", "LCD", "LPWD", "MODE", "SMB", "TAR", "PATH", "DATE", "$accept",
367 "ucommand", "set_command", "display_command", "quit_command",
368 "add_command", "add_path", "addx_command", "addx_path", "delete_command",
369 "delete_path", "deletex_command", "deletex_path", "local_command",
370 "help_command", "extract_command", 0
375 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
377 static const unsigned short yytoknum[] =
379 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
380 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
381 275, 276, 277, 278, 279, 280, 281, 282, 283, 284
385 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
386 static const unsigned char yyr1[] =
388 0, 30, 31, 31, 31, 31, 31, 31, 31, 31,
389 31, 31, 32, 32, 32, 32, 32, 32, 32, 32,
390 32, 32, 32, 32, 33, 33, 33, 33, 33, 33,
391 33, 34, 35, 36, 36, 37, 38, 38, 39, 40,
392 40, 41, 42, 42, 43, 43, 44, 45
395 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
396 static const unsigned char yyr2[] =
398 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 2, 1, 2, 2, 3, 2, 2, 1,
400 2, 2, 2, 2, 1, 1, 2, 1, 1, 1,
401 1, 1, 2, 2, 1, 2, 2, 1, 2, 2,
402 1, 2, 2, 1, 1, 2, 1, 1
405 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
406 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
407 means the default is an error. */
408 static const unsigned char yydefact[] =
410 0, 13, 0, 0, 0, 19, 0, 0, 0, 31,
411 24, 25, 0, 0, 47, 27, 0, 0, 28, 29,
412 46, 0, 44, 30, 0, 2, 3, 4, 5, 6,
413 7, 8, 9, 10, 11, 12, 15, 17, 14, 18,
414 22, 23, 20, 21, 34, 32, 37, 35, 26, 40,
415 38, 43, 41, 45, 1, 16, 33, 36, 39, 42
418 /* YYDEFGOTO[NTERM-NUM]. */
419 static const yysigned_char yydefgoto[] =
421 -1, 24, 25, 26, 27, 28, 45, 29, 47, 30,
422 50, 31, 52, 32, 33, 34
425 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
427 #define YYPACT_NINF -6
428 static const yysigned_char yypact[] =
430 -3, -5, -1, 0, 1, 3, -2, 4, 5, -6,
431 -6, -6, 6, 7, -6, 8, 9, 10, -6, -6,
432 -6, 11, -6, -6, 26, -6, -6, -6, -6, -6,
433 -6, -6, -6, -6, -6, -6, -6, 12, -6, -6,
434 -6, -6, -6, -6, -6, 13, -6, 14, -6, -6,
435 15, -6, 16, -6, -6, -6, -6, -6, -6, -6
438 /* YYPGOTO[NTERM-NUM]. */
439 static const yysigned_char yypgoto[] =
441 -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
442 -6, -6, -6, -6, -6, -6
445 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
446 positive, shift that token. If negative, reduce the rule which
447 number is the opposite. If zero, do what YYDEFACT says.
448 If YYTABLE_NINF, syntax error. */
449 #define YYTABLE_NINF -1
450 static const unsigned char yytable[] =
452 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
453 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
454 21, 22, 23, 35, 40, 41, 54, 36, 37, 0,
455 38, 39, 42, 43, 44, 46, 48, 49, 51, 53,
459 static const yysigned_char yycheck[] =
461 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
462 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
463 23, 24, 25, 28, 26, 27, 0, 28, 28, -1,
464 29, 28, 28, 28, 28, 28, 28, 28, 28, 28,
468 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
469 symbol of state STATE-NUM. */
470 static const unsigned char yystos[] =
472 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
473 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
474 22, 23, 24, 25, 31, 32, 33, 34, 35, 37,
475 39, 41, 43, 44, 45, 28, 28, 28, 29, 28,
476 26, 27, 28, 28, 28, 36, 28, 38, 28, 28,
477 40, 28, 42, 28, 0, 28, 28, 28, 28, 28
480 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
481 # define YYSIZE_T __SIZE_TYPE__
483 #if ! defined (YYSIZE_T) && defined (size_t)
484 # define YYSIZE_T size_t
486 #if ! defined (YYSIZE_T)
487 # if defined (__STDC__) || defined (__cplusplus)
488 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
489 # define YYSIZE_T size_t
492 #if ! defined (YYSIZE_T)
493 # define YYSIZE_T unsigned int
496 #define yyerrok (yyerrstatus = 0)
497 #define yyclearin (yychar = YYEMPTY)
501 #define YYACCEPT goto yyacceptlab
502 #define YYABORT goto yyabortlab
503 #define YYERROR goto yyerrorlab
506 /* Like YYERROR except do call yyerror. This remains here temporarily
507 to ease the transition to the new meaning of YYERROR, for GCC.
508 Once GCC version 2 has supplanted version 1, this can go. */
510 #define YYFAIL goto yyerrlab
512 #define YYRECOVERING() (!!yyerrstatus)
514 #define YYBACKUP(Token, Value) \
516 if (yychar == YYEMPTY && yylen == 1) \
520 yytoken = YYTRANSLATE (yychar); \
526 yyerror ("syntax error: cannot back up");\
532 #define YYERRCODE 256
534 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
537 #ifndef YYLLOC_DEFAULT
538 # define YYLLOC_DEFAULT(Current, Rhs, N) \
539 ((Current).first_line = (Rhs)[1].first_line, \
540 (Current).first_column = (Rhs)[1].first_column, \
541 (Current).last_line = (Rhs)[N].last_line, \
542 (Current).last_column = (Rhs)[N].last_column)
545 /* YYLEX -- calling `yylex' with the right arguments. */
548 # define YYLEX yylex (YYLEX_PARAM)
550 # define YYLEX yylex ()
553 /* Enable debugging if requested. */
557 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
558 # define YYFPRINTF fprintf
561 # define YYDPRINTF(Args) \
567 # define YYDSYMPRINT(Args) \
573 # define YYDSYMPRINTF(Title, Token, Value, Location) \
577 YYFPRINTF (stderr, "%s ", Title); \
578 yysymprint (stderr, \
580 YYFPRINTF (stderr, "\n"); \
584 /*------------------------------------------------------------------.
585 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
587 `------------------------------------------------------------------*/
589 #if defined (__STDC__) || defined (__cplusplus)
591 yy_stack_print (short *bottom, short *top)
594 yy_stack_print (bottom, top)
599 YYFPRINTF (stderr, "Stack now");
600 for (/* Nothing. */; bottom <= top; ++bottom)
601 YYFPRINTF (stderr, " %d", *bottom);
602 YYFPRINTF (stderr, "\n");
605 # define YY_STACK_PRINT(Bottom, Top) \
608 yy_stack_print ((Bottom), (Top)); \
612 /*------------------------------------------------.
613 | Report that the YYRULE is going to be reduced. |
614 `------------------------------------------------*/
616 #if defined (__STDC__) || defined (__cplusplus)
618 yy_reduce_print (int yyrule)
621 yy_reduce_print (yyrule)
626 unsigned int yylno = yyrline[yyrule];
627 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
629 /* Print the symbols being reduced, and their result. */
630 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
631 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
632 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
635 # define YY_REDUCE_PRINT(Rule) \
638 yy_reduce_print (Rule); \
641 /* Nonzero means print parse trace. It is left uninitialized so that
642 multiple parsers can coexist. */
645 # define YYDPRINTF(Args)
646 # define YYDSYMPRINT(Args)
647 # define YYDSYMPRINTF(Title, Token, Value, Location)
648 # define YY_STACK_PRINT(Bottom, Top)
649 # define YY_REDUCE_PRINT(Rule)
650 #endif /* !YYDEBUG */
653 /* YYINITDEPTH -- initial size of the parser's stacks. */
655 # define YYINITDEPTH 200
658 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
659 if the built-in stack extension method is used).
661 Do not make this value too large; the results are undefined if
662 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
663 evaluated with infinite-precision integer arithmetic. */
665 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
670 # define YYMAXDEPTH 10000
678 # if defined (__GLIBC__) && defined (_STRING_H)
679 # define yystrlen strlen
681 /* Return the length of YYSTR. */
683 # if defined (__STDC__) || defined (__cplusplus)
684 yystrlen (const char *yystr)
690 register const char *yys = yystr;
692 while (*yys++ != '\0')
695 return yys - yystr - 1;
701 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
702 # define yystpcpy stpcpy
704 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
707 # if defined (__STDC__) || defined (__cplusplus)
708 yystpcpy (char *yydest, const char *yysrc)
710 yystpcpy (yydest, yysrc)
715 register char *yyd = yydest;
716 register const char *yys = yysrc;
718 while ((*yyd++ = *yys++) != '\0')
726 #endif /* !YYERROR_VERBOSE */
731 /*--------------------------------.
732 | Print this symbol on YYOUTPUT. |
733 `--------------------------------*/
735 #if defined (__STDC__) || defined (__cplusplus)
737 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
740 yysymprint (yyoutput, yytype, yyvaluep)
746 /* Pacify ``unused variable'' warnings. */
749 if (yytype < YYNTOKENS)
751 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
753 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
757 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
764 YYFPRINTF (yyoutput, ")");
767 #endif /* ! YYDEBUG */
768 /*-----------------------------------------------.
769 | Release the memory associated to this symbol. |
770 `-----------------------------------------------*/
772 #if defined (__STDC__) || defined (__cplusplus)
774 yydestruct (int yytype, YYSTYPE *yyvaluep)
777 yydestruct (yytype, yyvaluep)
782 /* Pacify ``unused variable'' warnings. */
794 /* Prevent warnings from -Wmissing-prototypes. */
797 # if defined (__STDC__) || defined (__cplusplus)
798 int yyparse (void *YYPARSE_PARAM);
802 #else /* ! YYPARSE_PARAM */
803 #if defined (__STDC__) || defined (__cplusplus)
808 #endif /* ! YYPARSE_PARAM */
812 /* The lookahead symbol. */
815 /* The semantic value of the lookahead symbol. */
818 /* Number of syntax errors so far. */
828 # if defined (__STDC__) || defined (__cplusplus)
829 int yyparse (void *YYPARSE_PARAM)
831 int yyparse (YYPARSE_PARAM)
834 #else /* ! YYPARSE_PARAM */
835 #if defined (__STDC__) || defined (__cplusplus)
846 register int yystate;
849 /* Number of tokens to shift before error messages enabled. */
851 /* Lookahead token as an internal (translated) token number. */
854 /* Three stacks and their tools:
855 `yyss': related to states,
856 `yyvs': related to semantic values,
857 `yyls': related to locations.
859 Refer to the stacks thru separate pointers, to allow yyoverflow
860 to reallocate them elsewhere. */
862 /* The state stack. */
863 short yyssa[YYINITDEPTH];
865 register short *yyssp;
867 /* The semantic value stack. */
868 YYSTYPE yyvsa[YYINITDEPTH];
869 YYSTYPE *yyvs = yyvsa;
870 register YYSTYPE *yyvsp;
874 #define YYPOPSTACK (yyvsp--, yyssp--)
876 YYSIZE_T yystacksize = YYINITDEPTH;
878 /* The variables used to return semantic value and location from the
883 /* When reducing, the number of symbols on the RHS of the reduced
887 YYDPRINTF ((stderr, "Starting parse\n"));
892 yychar = YYEMPTY; /* Cause a token to be read. */
894 /* Initialize stack pointers.
895 Waste one element of value and location stack
896 so that they stay on the same level as the state stack.
897 The wasted elements are never initialized. */
904 /*------------------------------------------------------------.
905 | yynewstate -- Push a new state, which is found in yystate. |
906 `------------------------------------------------------------*/
908 /* In all cases, when you get here, the value and location stacks
909 have just been pushed. so pushing a state here evens the stacks.
916 if (yyss + yystacksize - 1 <= yyssp)
918 /* Get the current used size of the three stacks, in elements. */
919 YYSIZE_T yysize = yyssp - yyss + 1;
923 /* Give user a chance to reallocate the stack. Use copies of
924 these so that the &'s don't force the real ones into
926 YYSTYPE *yyvs1 = yyvs;
930 /* Each stack pointer address is followed by the size of the
931 data in use in that stack, in bytes. This used to be a
932 conditional around just the two extra args, but that might
933 be undefined if yyoverflow is a macro. */
934 yyoverflow ("parser stack overflow",
935 &yyss1, yysize * sizeof (*yyssp),
936 &yyvs1, yysize * sizeof (*yyvsp),
943 #else /* no yyoverflow */
944 # ifndef YYSTACK_RELOCATE
947 /* Extend the stack our own way. */
948 if (YYMAXDEPTH <= yystacksize)
951 if (YYMAXDEPTH < yystacksize)
952 yystacksize = YYMAXDEPTH;
956 union yyalloc *yyptr =
957 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
960 YYSTACK_RELOCATE (yyss);
961 YYSTACK_RELOCATE (yyvs);
963 # undef YYSTACK_RELOCATE
965 YYSTACK_FREE (yyss1);
968 #endif /* no yyoverflow */
970 yyssp = yyss + yysize - 1;
971 yyvsp = yyvs + yysize - 1;
974 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
975 (unsigned long int) yystacksize));
977 if (yyss + yystacksize - 1 <= yyssp)
981 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
990 /* Do appropriate processing given the current state. */
991 /* Read a lookahead token if we need one and don't already have one. */
994 /* First try to decide what to do without reference to lookahead token. */
996 yyn = yypact[yystate];
997 if (yyn == YYPACT_NINF)
1000 /* Not known => get a lookahead token if don't already have one. */
1002 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1003 if (yychar == YYEMPTY)
1005 YYDPRINTF ((stderr, "Reading a token: "));
1009 if (yychar <= YYEOF)
1011 yychar = yytoken = YYEOF;
1012 YYDPRINTF ((stderr, "Now at end of input.\n"));
1016 yytoken = YYTRANSLATE (yychar);
1017 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1020 /* If the proper action on seeing token YYTOKEN is to reduce or to
1021 detect an error, take that action. */
1023 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1028 if (yyn == 0 || yyn == YYTABLE_NINF)
1037 /* Shift the lookahead token. */
1038 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1040 /* Discard the token being shifted unless it is eof. */
1041 if (yychar != YYEOF)
1047 /* Count tokens shifted since error; after three, turn off error
1056 /*-----------------------------------------------------------.
1057 | yydefault -- do the default action for the current state. |
1058 `-----------------------------------------------------------*/
1060 yyn = yydefact[yystate];
1066 /*-----------------------------.
1067 | yyreduce -- Do a reduction. |
1068 `-----------------------------*/
1070 /* yyn is the number of a rule to reduce with. */
1073 /* If YYLEN is nonzero, implement the default value of the action:
1076 Otherwise, the following line sets YYVAL to garbage.
1077 This behavior is undocumented and Bison
1078 users should not rely upon it. Assigning to YYVAL
1079 unconditionally makes the parser a bit smaller, and it avoids a
1080 GCC warning that YYVAL may be used uninitialized. */
1081 yyval = yyvsp[1-yylen];
1084 YY_REDUCE_PRINT (yyn);
1089 { list_disk(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1094 { list_disk(NULL); }
1099 { set_date(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1104 { set_host(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1109 { set_disk(yyvsp[-1].strval, yyvsp[0].strval); amfree(yyvsp[-1].strval); amfree(yyvsp[0].strval); }
1114 { set_disk(yyvsp[0].strval, NULL); amfree(yyvsp[0].strval); }
1119 { set_tape(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1129 { cd_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1134 { cd_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1141 set_mode(SAMBA_SMBCLIENT);
1142 #endif /* SAMBA_CLIENT */
1150 set_mode(SAMBA_TAR);
1151 #endif /* SAMBA_CLIENT */
1157 { list_disk_history(); }
1161 #line 100 "uparse.y"
1162 { list_directory(); }
1166 #line 101 "uparse.y"
1167 { display_extract_list(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1171 #line 102 "uparse.y"
1172 { display_extract_list(NULL); }
1176 #line 103 "uparse.y"
1177 { show_directory(); }
1181 #line 104 "uparse.y"
1182 { clear_extract_list(); }
1186 #line 105 "uparse.y"
1191 #line 109 "uparse.y"
1196 #line 117 "uparse.y"
1197 { add_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1201 #line 118 "uparse.y"
1202 { add_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1206 #line 126 "uparse.y"
1207 { add_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1211 #line 127 "uparse.y"
1212 { add_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1216 #line 135 "uparse.y"
1217 { delete_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1221 #line 136 "uparse.y"
1222 { delete_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1226 #line 144 "uparse.y"
1227 { delete_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1231 #line 145 "uparse.y"
1232 { delete_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1236 #line 149 "uparse.y"
1237 { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); }
1241 #line 150 "uparse.y"
1243 if (chdir(yyvsp[0].strval) == -1) {
1244 perror(yyvsp[0].strval);
1246 amfree(yyvsp[0].strval);
1251 #line 159 "uparse.y"
1256 #line 163 "uparse.y"
1257 { extract_files(); }
1263 /* Line 1000 of yacc.c. */
1264 #line 1265 "uparse.c"
1270 YY_STACK_PRINT (yyss, yyssp);
1275 /* Now `shift' the result of the reduction. Determine what state
1276 that goes to, based on the state we popped back to and the rule
1277 number reduced by. */
1281 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1282 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1283 yystate = yytable[yystate];
1285 yystate = yydefgoto[yyn - YYNTOKENS];
1290 /*------------------------------------.
1291 | yyerrlab -- here on detecting error |
1292 `------------------------------------*/
1294 /* If not already recovering from an error, report this error. */
1299 yyn = yypact[yystate];
1301 if (YYPACT_NINF < yyn && yyn < YYLAST)
1303 YYSIZE_T yysize = 0;
1304 int yytype = YYTRANSLATE (yychar);
1305 const char* yyprefix;
1309 /* Start YYX at -YYN if negative to avoid negative indexes in
1311 int yyxbegin = yyn < 0 ? -yyn : 0;
1313 /* Stay within bounds of both yycheck and yytname. */
1314 int yychecklim = YYLAST - yyn;
1315 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1318 yyprefix = ", expecting ";
1319 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1320 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1322 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
1330 yysize += (sizeof ("syntax error, unexpected ")
1331 + yystrlen (yytname[yytype]));
1332 yymsg = (char *) YYSTACK_ALLOC (yysize);
1335 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1336 yyp = yystpcpy (yyp, yytname[yytype]);
1340 yyprefix = ", expecting ";
1341 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1342 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1344 yyp = yystpcpy (yyp, yyprefix);
1345 yyp = yystpcpy (yyp, yytname[yyx]);
1350 YYSTACK_FREE (yymsg);
1353 yyerror ("syntax error; also virtual memory exhausted");
1356 #endif /* YYERROR_VERBOSE */
1357 yyerror ("syntax error");
1362 if (yyerrstatus == 3)
1364 /* If just tried and failed to reuse lookahead token after an
1365 error, discard it. */
1367 if (yychar <= YYEOF)
1369 /* If at end of input, pop the error token,
1370 then the rest of the stack, then return failure. */
1371 if (yychar == YYEOF)
1377 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1378 yydestruct (yystos[*yyssp], yyvsp);
1383 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1384 yydestruct (yytoken, &yylval);
1390 /* Else will try to reuse lookahead token after shifting the error
1395 /*---------------------------------------------------.
1396 | yyerrorlab -- error raised explicitly by YYERROR. |
1397 `---------------------------------------------------*/
1401 /* Pacify GCC when the user code never invokes YYERROR and the label
1402 yyerrorlab therefore never appears in user code. */
1413 /*-------------------------------------------------------------.
1414 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1415 `-------------------------------------------------------------*/
1417 yyerrstatus = 3; /* Each real token shifted decrements this. */
1421 yyn = yypact[yystate];
1422 if (yyn != YYPACT_NINF)
1425 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1433 /* Pop the current state because it cannot handle the error token. */
1437 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1438 yydestruct (yystos[yystate], yyvsp);
1441 YY_STACK_PRINT (yyss, yyssp);
1447 YYDPRINTF ((stderr, "Shifting error token, "));
1456 /*-------------------------------------.
1457 | yyacceptlab -- YYACCEPT comes here. |
1458 `-------------------------------------*/
1463 /*-----------------------------------.
1464 | yyabortlab -- YYABORT comes here. |
1465 `-----------------------------------*/
1471 /*----------------------------------------------.
1472 | yyoverflowlab -- parser overflow comes here. |
1473 `----------------------------------------------*/
1475 yyerror ("parser stack overflow");
1483 YYSTACK_FREE (yyss);
1489 #line 167 "uparse.y"
1495 printf("Invalid command - %s\n", s);