1 /* A Bison parser, made from uparse.y
4 #define YYBISON 1 /* Identify Bison output. */
37 #include "amrecover.h"
39 void yyerror P((char *s));
40 extern int yylex P((void));
50 # define YYSTYPE yystype
51 # define YYSTYPE_IS_TRIVIAL 1
63 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
64 #define YYTRANSLATE(x) ((unsigned)(x) <= 283 ? yytranslate[x] : 45)
66 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
67 static const char yytranslate[] =
69 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
70 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
71 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
72 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
73 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
74 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
75 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
76 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
77 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
78 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
79 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
80 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
81 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
82 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
83 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
84 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
85 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
86 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
87 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
88 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
89 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
90 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
91 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
92 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
93 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
94 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
95 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
96 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
101 static const short yyprhs[] =
103 0, 0, 2, 4, 6, 8, 10, 12, 14, 16,
104 18, 20, 23, 25, 28, 31, 35, 38, 41, 43,
105 46, 49, 52, 55, 57, 59, 62, 64, 66, 68,
106 70, 72, 75, 78, 80, 83, 86, 88, 91, 94,
107 96, 99, 102, 104, 106, 109, 111
109 static const short yyrhs[] =
111 31, 0, 32, 0, 33, 0, 34, 0, 36, 0,
112 38, 0, 40, 0, 42, 0, 43, 0, 44, 0,
113 3, 28, 0, 3, 0, 6, 29, 0, 4, 28,
114 0, 5, 28, 28, 0, 5, 28, 0, 7, 28,
115 0, 7, 0, 9, 28, 0, 10, 28, 0, 8,
116 26, 0, 8, 27, 0, 12, 0, 13, 0, 17,
117 28, 0, 17, 0, 20, 0, 21, 0, 25, 0,
118 11, 0, 14, 35, 0, 35, 28, 0, 28, 0,
119 15, 37, 0, 37, 28, 0, 28, 0, 18, 39,
120 0, 39, 28, 0, 28, 0, 19, 41, 0, 41,
121 28, 0, 28, 0, 24, 0, 23, 28, 0, 22,
128 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
129 static const short yyrline[] =
131 0, 62, 64, 65, 66, 67, 68, 69, 70, 71,
132 72, 75, 77, 78, 79, 80, 81, 82, 83, 84,
133 85, 86, 91, 98, 100, 101, 102, 103, 104, 105,
134 108, 112, 116, 118, 121, 125, 127, 130, 134, 136,
135 139, 143, 145, 148, 150, 158, 162
140 #if (YYDEBUG) || defined YYERROR_VERBOSE
142 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
143 static const char *const yytname[] =
145 "$", "error", "$undefined.", "LISTDISK", "SETHOST", "SETDISK", "SETDATE",
146 "SETTAPE", "SETMODE", "CD", "CDX", "QUIT", "DHIST", "LS", "ADD", "ADDX",
147 "EXTRACT", "LIST", "DELETE", "DELETEX", "PWD", "CLEAR", "HELP", "LCD",
148 "LPWD", "MODE", "SMB", "TAR", "PATH", "DATE", "ucommand", "set_command",
149 "display_command", "quit_command", "add_command", "add_path",
150 "addx_command", "addx_path", "delete_command", "delete_path",
151 "deletex_command", "deletex_path", "local_command", "help_command",
156 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
157 static const short yyr1[] =
159 0, 30, 30, 30, 30, 30, 30, 30, 30, 30,
160 30, 31, 31, 31, 31, 31, 31, 31, 31, 31,
161 31, 31, 31, 32, 32, 32, 32, 32, 32, 32,
162 33, 34, 35, 35, 36, 37, 37, 38, 39, 39,
163 40, 41, 41, 42, 42, 43, 44
166 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
167 static const short yyr2[] =
169 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
170 1, 2, 1, 2, 2, 3, 2, 2, 1, 2,
171 2, 2, 2, 1, 1, 2, 1, 1, 1, 1,
172 1, 2, 2, 1, 2, 2, 1, 2, 2, 1,
176 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
177 doesn't specify something else to do. Zero means the default is an
179 static const short yydefact[] =
181 0, 12, 0, 0, 0, 18, 0, 0, 0, 30,
182 23, 24, 0, 0, 46, 26, 0, 0, 27, 28,
183 45, 0, 43, 29, 1, 2, 3, 4, 5, 6,
184 7, 8, 9, 10, 11, 14, 16, 13, 17, 21,
185 22, 19, 20, 33, 31, 36, 34, 25, 39, 37,
186 42, 40, 44, 15, 32, 35, 38, 41, 0, 0,
190 static const short yydefgoto[] =
192 58, 24, 25, 26, 27, 44, 28, 46, 29, 49,
196 static const short yypact[] =
198 -3, -5, -1, 0, 1, 3, -2, 4, 5,-32768,
199 -32768,-32768, 6, 7,-32768, 8, 9, 10,-32768,-32768,
200 -32768, 11,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
201 -32768,-32768,-32768,-32768,-32768,-32768, 12,-32768,-32768,-32768,
202 -32768,-32768,-32768,-32768, 13,-32768, 14,-32768,-32768, 15,
203 -32768, 16,-32768,-32768,-32768,-32768,-32768,-32768, 26, 29,
207 static const short yypgoto[] =
209 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
210 -32768,-32768,-32768,-32768,-32768
217 static const short yytable[] =
219 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
220 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
221 21, 22, 23, 34, 39, 40, 59, 35, 36, 60,
222 37, 38, 41, 42, 43, 45, 47, 48, 50, 52,
226 static const short yycheck[] =
228 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
229 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
230 23, 24, 25, 28, 26, 27, 0, 28, 28, 0,
231 29, 28, 28, 28, 28, 28, 28, 28, 28, 28,
234 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
235 #line 3 "/usr/share/bison/bison.simple"
237 /* Skeleton output parser for bison,
239 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
242 This program is free software; you can redistribute it and/or modify
243 it under the terms of the GNU General Public License as published by
244 the Free Software Foundation; either version 2, or (at your option)
247 This program is distributed in the hope that it will be useful,
248 but WITHOUT ANY WARRANTY; without even the implied warranty of
249 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
250 GNU General Public License for more details.
252 You should have received a copy of the GNU General Public License
253 along with this program; if not, write to the Free Software
254 Foundation, Inc., 59 Temple Place - Suite 330,
255 Boston, MA 02111-1307, USA. */
257 /* As a special exception, when this file is copied by Bison into a
258 Bison output file, you may use that output file without restriction.
259 This special exception was added by the Free Software Foundation
260 in version 1.24 of Bison. */
262 /* This is the parser code that is written into each bison parser when
263 the %semantic_parser declaration is not specified in the grammar.
264 It was written by Richard Stallman by simplifying the hairy parser
265 used when %semantic_parser is specified. */
267 /* All symbols defined below should begin with yy or YY, to avoid
268 infringing on user name space. This should be done even for local
269 variables, as they might otherwise be expanded by user macros.
270 There are some unavoidable exceptions within include files to
271 define necessary library symbols; they are noted "INFRINGES ON
272 USER NAME SPACE" below. */
274 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
276 /* The parser invokes alloca or malloc; define the necessary symbols. */
278 # if YYSTACK_USE_ALLOCA
279 # define YYSTACK_ALLOC alloca
281 # ifndef YYSTACK_USE_ALLOCA
282 # if defined (alloca) || defined (_ALLOCA_H)
283 # define YYSTACK_ALLOC alloca
286 # define YYSTACK_ALLOC __builtin_alloca
292 # ifdef YYSTACK_ALLOC
293 /* Pacify GCC's `empty if-body' warning. */
294 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
296 # if defined (__STDC__) || defined (__cplusplus)
297 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
298 # define YYSIZE_T size_t
300 # define YYSTACK_ALLOC malloc
301 # define YYSTACK_FREE free
303 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
306 #if (! defined (yyoverflow) \
307 && (! defined (__cplusplus) \
308 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
310 /* A type that is properly aligned for any stack member. */
320 /* The size of the maximum gap between one aligned stack and the next. */
321 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
323 /* The size of an array large to enough to hold all stacks, each with
326 # define YYSTACK_BYTES(N) \
327 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
328 + 2 * YYSTACK_GAP_MAX)
330 # define YYSTACK_BYTES(N) \
331 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
335 /* Copy COUNT objects from FROM to TO. The source and destination do
339 # define YYCOPY(To, From, Count) \
340 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
342 # define YYCOPY(To, From, Count) \
345 register YYSIZE_T yyi; \
346 for (yyi = 0; yyi < (Count); yyi++) \
347 (To)[yyi] = (From)[yyi]; \
353 /* Relocate STACK from its old location to the new one. The
354 local variables YYSIZE and YYSTACKSIZE give the old and new number of
355 elements in the stack, and YYPTR gives the new location of the
356 stack. Advance YYPTR to a properly aligned location for the next
358 # define YYSTACK_RELOCATE(Stack) \
361 YYSIZE_T yynewbytes; \
362 YYCOPY (&yyptr->Stack, Stack, yysize); \
363 Stack = &yyptr->Stack; \
364 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
365 yyptr += yynewbytes / sizeof (*yyptr); \
372 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
373 # define YYSIZE_T __SIZE_TYPE__
375 #if ! defined (YYSIZE_T) && defined (size_t)
376 # define YYSIZE_T size_t
378 #if ! defined (YYSIZE_T)
379 # if defined (__STDC__) || defined (__cplusplus)
380 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
381 # define YYSIZE_T size_t
384 #if ! defined (YYSIZE_T)
385 # define YYSIZE_T unsigned int
388 #define yyerrok (yyerrstatus = 0)
389 #define yyclearin (yychar = YYEMPTY)
392 #define YYACCEPT goto yyacceptlab
393 #define YYABORT goto yyabortlab
394 #define YYERROR goto yyerrlab1
395 /* Like YYERROR except do call yyerror. This remains here temporarily
396 to ease the transition to the new meaning of YYERROR, for GCC.
397 Once GCC version 2 has supplanted version 1, this can go. */
398 #define YYFAIL goto yyerrlab
399 #define YYRECOVERING() (!!yyerrstatus)
400 #define YYBACKUP(Token, Value) \
402 if (yychar == YYEMPTY && yylen == 1) \
406 yychar1 = YYTRANSLATE (yychar); \
412 yyerror ("syntax error: cannot back up"); \
418 #define YYERRCODE 256
421 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
424 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
425 first token. By default, to implement support for ranges, extend
426 its range to the last symbol. */
428 #ifndef YYLLOC_DEFAULT
429 # define YYLLOC_DEFAULT(Current, Rhs, N) \
430 Current.last_line = Rhs[N].last_line; \
431 Current.last_column = Rhs[N].last_column;
435 /* YYLEX -- calling `yylex' with the right arguments. */
440 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
442 # define YYLEX yylex (&yylval, &yylloc)
444 # else /* !YYLSP_NEEDED */
446 # define YYLEX yylex (&yylval, YYLEX_PARAM)
448 # define YYLEX yylex (&yylval)
450 # endif /* !YYLSP_NEEDED */
452 # define YYLEX yylex ()
456 /* Enable debugging if requested. */
460 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
461 # define YYFPRINTF fprintf
464 # define YYDPRINTF(Args) \
469 /* Nonzero means print parse trace. It is left uninitialized so that
470 multiple parsers can coexist. */
473 # define YYDPRINTF(Args)
474 #endif /* !YYDEBUG */
476 /* YYINITDEPTH -- initial size of the parser's stacks. */
478 # define YYINITDEPTH 200
481 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
482 if the built-in stack extension method is used).
484 Do not make this value too large; the results are undefined if
485 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
486 evaluated with infinite-precision integer arithmetic. */
493 # define YYMAXDEPTH 10000
496 #ifdef YYERROR_VERBOSE
499 # if defined (__GLIBC__) && defined (_STRING_H)
500 # define yystrlen strlen
502 /* Return the length of YYSTR. */
504 # if defined (__STDC__) || defined (__cplusplus)
505 yystrlen (const char *yystr)
511 register const char *yys = yystr;
513 while (*yys++ != '\0')
516 return yys - yystr - 1;
522 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
523 # define yystpcpy stpcpy
525 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
528 # if defined (__STDC__) || defined (__cplusplus)
529 yystpcpy (char *yydest, const char *yysrc)
531 yystpcpy (yydest, yysrc)
536 register char *yyd = yydest;
537 register const char *yys = yysrc;
539 while ((*yyd++ = *yys++) != '\0')
548 #line 315 "/usr/share/bison/bison.simple"
551 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
552 into yyparse. The argument should have type void *.
553 It should actually point to an object.
554 Grammar actions can access the variable by casting it
555 to the proper pointer type. */
558 # if defined (__STDC__) || defined (__cplusplus)
559 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
560 # define YYPARSE_PARAM_DECL
562 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
563 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
565 #else /* !YYPARSE_PARAM */
566 # define YYPARSE_PARAM_ARG
567 # define YYPARSE_PARAM_DECL
568 #endif /* !YYPARSE_PARAM */
570 /* Prevent warning if -Wstrict-prototypes. */
572 # ifdef YYPARSE_PARAM
573 int yyparse (void *);
579 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
580 variables are global, or local to YYPARSE. */
582 #define YY_DECL_NON_LSP_VARIABLES \
583 /* The lookahead symbol. */ \
586 /* The semantic value of the lookahead symbol. */ \
589 /* Number of parse errors so far. */ \
593 # define YY_DECL_VARIABLES \
594 YY_DECL_NON_LSP_VARIABLES \
596 /* Location data for the lookahead symbol. */ \
599 # define YY_DECL_VARIABLES \
600 YY_DECL_NON_LSP_VARIABLES
604 /* If nonreentrant, generate the variables here. */
611 yyparse (YYPARSE_PARAM_ARG)
614 /* If reentrant, generate the variables here. */
619 register int yystate;
622 /* Number of tokens to shift before error messages enabled. */
624 /* Lookahead token as an internal (translated) token number. */
627 /* Three stacks and their tools:
628 `yyss': related to states,
629 `yyvs': related to semantic values,
630 `yyls': related to locations.
632 Refer to the stacks thru separate pointers, to allow yyoverflow
633 to reallocate them elsewhere. */
635 /* The state stack. */
636 short yyssa[YYINITDEPTH];
638 register short *yyssp;
640 /* The semantic value stack. */
641 YYSTYPE yyvsa[YYINITDEPTH];
642 YYSTYPE *yyvs = yyvsa;
643 register YYSTYPE *yyvsp;
646 /* The location stack. */
647 YYLTYPE yylsa[YYINITDEPTH];
648 YYLTYPE *yyls = yylsa;
653 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
655 # define YYPOPSTACK (yyvsp--, yyssp--)
658 YYSIZE_T yystacksize = YYINITDEPTH;
661 /* The variables used to return semantic value and location from the
668 /* When reducing, the number of symbols on the RHS of the reduced
672 YYDPRINTF ((stderr, "Starting parse\n"));
677 yychar = YYEMPTY; /* Cause a token to be read. */
679 /* Initialize stack pointers.
680 Waste one element of value and location stack
681 so that they stay on the same level as the state stack.
682 The wasted elements are never initialized. */
691 /*------------------------------------------------------------.
692 | yynewstate -- Push a new state, which is found in yystate. |
693 `------------------------------------------------------------*/
695 /* In all cases, when you get here, the value and location stacks
696 have just been pushed. so pushing a state here evens the stacks.
703 if (yyssp >= yyss + yystacksize - 1)
705 /* Get the current used size of the three stacks, in elements. */
706 YYSIZE_T yysize = yyssp - yyss + 1;
710 /* Give user a chance to reallocate the stack. Use copies of
711 these so that the &'s don't force the real ones into
713 YYSTYPE *yyvs1 = yyvs;
716 /* Each stack pointer address is followed by the size of the
717 data in use in that stack, in bytes. */
719 YYLTYPE *yyls1 = yyls;
720 /* This used to be a conditional around just the two extra args,
721 but that might be undefined if yyoverflow is a macro. */
722 yyoverflow ("parser stack overflow",
723 &yyss1, yysize * sizeof (*yyssp),
724 &yyvs1, yysize * sizeof (*yyvsp),
725 &yyls1, yysize * sizeof (*yylsp),
729 yyoverflow ("parser stack overflow",
730 &yyss1, yysize * sizeof (*yyssp),
731 &yyvs1, yysize * sizeof (*yyvsp),
737 #else /* no yyoverflow */
738 # ifndef YYSTACK_RELOCATE
741 /* Extend the stack our own way. */
742 if (yystacksize >= YYMAXDEPTH)
745 if (yystacksize > YYMAXDEPTH)
746 yystacksize = YYMAXDEPTH;
750 union yyalloc *yyptr =
751 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
754 YYSTACK_RELOCATE (yyss);
755 YYSTACK_RELOCATE (yyvs);
757 YYSTACK_RELOCATE (yyls);
759 # undef YYSTACK_RELOCATE
761 YYSTACK_FREE (yyss1);
764 #endif /* no yyoverflow */
766 yyssp = yyss + yysize - 1;
767 yyvsp = yyvs + yysize - 1;
769 yylsp = yyls + yysize - 1;
772 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
773 (unsigned long int) yystacksize));
775 if (yyssp >= yyss + yystacksize - 1)
779 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
789 /* Do appropriate processing given the current state. */
790 /* Read a lookahead token if we need one and don't already have one. */
793 /* First try to decide what to do without reference to lookahead token. */
795 yyn = yypact[yystate];
799 /* Not known => get a lookahead token if don't already have one. */
801 /* yychar is either YYEMPTY or YYEOF
802 or a valid token in external form. */
804 if (yychar == YYEMPTY)
806 YYDPRINTF ((stderr, "Reading a token: "));
810 /* Convert token to internal form (in yychar1) for indexing tables with */
812 if (yychar <= 0) /* This means end of input. */
815 yychar = YYEOF; /* Don't call YYLEX any more */
817 YYDPRINTF ((stderr, "Now at end of input.\n"));
821 yychar1 = YYTRANSLATE (yychar);
824 /* We have to keep this `#if YYDEBUG', since we use variables
825 which are defined only if `YYDEBUG' is set. */
828 YYFPRINTF (stderr, "Next token is %d (%s",
829 yychar, yytname[yychar1]);
830 /* Give the individual parser a way to print the precise
831 meaning of a token, for further debugging info. */
833 YYPRINT (stderr, yychar, yylval);
835 YYFPRINTF (stderr, ")\n");
841 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
846 /* yyn is what to do for this token type in this state.
847 Negative => reduce, -yyn is rule number.
848 Positive => shift, yyn is new state.
849 New state is final state => don't bother to shift,
851 0, or most negative number => error. */
866 /* Shift the lookahead token. */
867 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
868 yychar, yytname[yychar1]));
870 /* Discard the token being shifted unless it is eof. */
879 /* Count tokens shifted since error; after three, turn off error
888 /*-----------------------------------------------------------.
889 | yydefault -- do the default action for the current state. |
890 `-----------------------------------------------------------*/
892 yyn = yydefact[yystate];
898 /*-----------------------------.
899 | yyreduce -- Do a reduction. |
900 `-----------------------------*/
902 /* yyn is the number of a rule to reduce with. */
905 /* If YYLEN is nonzero, implement the default value of the action:
908 Otherwise, the following line sets YYVAL to the semantic value of
909 the lookahead token. This behavior is undocumented and Bison
910 users should not rely upon it. Assigning to YYVAL
911 unconditionally makes the parser a bit smaller, and it avoids a
912 GCC warning that YYVAL may be used uninitialized. */
913 yyval = yyvsp[1-yylen];
916 /* Similarly for the default location. Let the user run additional
917 commands if for instance locations are ranges. */
918 yyloc = yylsp[1-yylen];
919 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
923 /* We have to keep this `#if YYDEBUG', since we use variables which
924 are defined only if `YYDEBUG' is set. */
929 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
932 /* Print the symbols being reduced, and their result. */
933 for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
934 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
935 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
943 { list_disk(yyvsp[0].strval); amfree(yyvsp[0].strval); }
951 { set_date(yyvsp[0].strval); amfree(yyvsp[0].strval); }
955 { set_host(yyvsp[0].strval); amfree(yyvsp[0].strval); }
959 { set_disk(yyvsp[-1].strval, yyvsp[0].strval); amfree(yyvsp[-1].strval); amfree(yyvsp[0].strval); }
963 { set_disk(yyvsp[0].strval, NULL); amfree(yyvsp[0].strval); }
967 { set_tape(yyvsp[0].strval); amfree(yyvsp[0].strval); }
975 { cd_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
979 { cd_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
985 set_mode(SAMBA_SMBCLIENT);
986 #endif /* SAMBA_CLIENT */
994 #endif /* SAMBA_CLIENT */
999 { list_disk_history(); }
1002 #line 100 "uparse.y"
1003 { list_directory(); }
1006 #line 101 "uparse.y"
1007 { display_extract_list(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1010 #line 102 "uparse.y"
1011 { display_extract_list(NULL); }
1014 #line 103 "uparse.y"
1015 { show_directory(); }
1018 #line 104 "uparse.y"
1019 { clear_extract_list(); }
1022 #line 105 "uparse.y"
1026 #line 109 "uparse.y"
1030 #line 117 "uparse.y"
1031 { add_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1034 #line 118 "uparse.y"
1035 { add_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1038 #line 126 "uparse.y"
1039 { add_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1042 #line 127 "uparse.y"
1043 { add_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1046 #line 135 "uparse.y"
1047 { delete_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1050 #line 136 "uparse.y"
1051 { delete_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1054 #line 144 "uparse.y"
1055 { delete_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1058 #line 145 "uparse.y"
1059 { delete_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1062 #line 149 "uparse.y"
1063 { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); }
1066 #line 150 "uparse.y"
1068 if (chdir(yyvsp[0].strval) == -1) {
1069 perror(yyvsp[0].strval);
1071 amfree(yyvsp[0].strval);
1075 #line 159 "uparse.y"
1079 #line 163 "uparse.y"
1080 { extract_files(); }
1084 #line 705 "/usr/share/bison/bison.simple"
1096 short *yyssp1 = yyss - 1;
1097 YYFPRINTF (stderr, "state stack now");
1098 while (yyssp1 != yyssp)
1099 YYFPRINTF (stderr, " %d", *++yyssp1);
1100 YYFPRINTF (stderr, "\n");
1109 /* Now `shift' the result of the reduction. Determine what state
1110 that goes to, based on the state we popped back to and the rule
1111 number reduced by. */
1115 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1116 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1117 yystate = yytable[yystate];
1119 yystate = yydefgoto[yyn - YYNTBASE];
1124 /*------------------------------------.
1125 | yyerrlab -- here on detecting error |
1126 `------------------------------------*/
1128 /* If not already recovering from an error, report this error. */
1133 #ifdef YYERROR_VERBOSE
1134 yyn = yypact[yystate];
1136 if (yyn > YYFLAG && yyn < YYLAST)
1138 YYSIZE_T yysize = 0;
1143 /* Start YYX at -YYN if negative to avoid negative indexes in
1145 for (yyx = yyn < 0 ? -yyn : 0;
1146 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1147 if (yycheck[yyx + yyn] == yyx)
1148 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1149 yysize += yystrlen ("parse error, unexpected ") + 1;
1150 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1151 yymsg = (char *) YYSTACK_ALLOC (yysize);
1154 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1155 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1160 for (yyx = yyn < 0 ? -yyn : 0;
1161 yyx < (int) (sizeof (yytname) / sizeof (char *));
1163 if (yycheck[yyx + yyn] == yyx)
1165 const char *yyq = ! yycount ? ", expecting " : " or ";
1166 yyp = yystpcpy (yyp, yyq);
1167 yyp = yystpcpy (yyp, yytname[yyx]);
1172 YYSTACK_FREE (yymsg);
1175 yyerror ("parse error; also virtual memory exhausted");
1178 #endif /* defined (YYERROR_VERBOSE) */
1179 yyerror ("parse error");
1184 /*--------------------------------------------------.
1185 | yyerrlab1 -- error raised explicitly by an action |
1186 `--------------------------------------------------*/
1188 if (yyerrstatus == 3)
1190 /* If just tried and failed to reuse lookahead token after an
1191 error, discard it. */
1193 /* return failure if at end of input */
1194 if (yychar == YYEOF)
1196 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1197 yychar, yytname[yychar1]));
1201 /* Else will try to reuse lookahead token after shifting the error
1204 yyerrstatus = 3; /* Each real token shifted decrements this */
1209 /*-------------------------------------------------------------------.
1210 | yyerrdefault -- current state does not do anything special for the |
1212 `-------------------------------------------------------------------*/
1215 /* This is wrong; only states that explicitly want error tokens
1216 should shift them. */
1218 /* If its default is to accept any token, ok. Otherwise pop it. */
1219 yyn = yydefact[yystate];
1225 /*---------------------------------------------------------------.
1226 | yyerrpop -- pop the current state because it cannot handle the |
1228 `---------------------------------------------------------------*/
1241 short *yyssp1 = yyss - 1;
1242 YYFPRINTF (stderr, "Error: state stack now");
1243 while (yyssp1 != yyssp)
1244 YYFPRINTF (stderr, " %d", *++yyssp1);
1245 YYFPRINTF (stderr, "\n");
1253 yyn = yypact[yystate];
1258 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1275 YYDPRINTF ((stderr, "Shifting error token, "));
1286 /*-------------------------------------.
1287 | yyacceptlab -- YYACCEPT comes here. |
1288 `-------------------------------------*/
1293 /*-----------------------------------.
1294 | yyabortlab -- YYABORT comes here. |
1295 `-----------------------------------*/
1300 /*---------------------------------------------.
1301 | yyoverflowab -- parser overflow comes here. |
1302 `---------------------------------------------*/
1304 yyerror ("parser stack overflow");
1311 YYSTACK_FREE (yyss);
1315 #line 167 "uparse.y"
1321 printf("Invalid command - %s\n", s);