Imported Upstream version 2.4.4p3
[debian/amanda] / recover-src / uparse.c
1 /* A Bison parser, made from uparse.y
2    by GNU bison 1.35.  */
3
4 #define YYBISON 1  /* Identify Bison output.  */
5
6 # define        LISTDISK        257
7 # define        SETHOST 258
8 # define        SETDISK 259
9 # define        SETDATE 260
10 # define        SETTAPE 261
11 # define        SETMODE 262
12 # define        CD      263
13 # define        CDX     264
14 # define        QUIT    265
15 # define        DHIST   266
16 # define        LS      267
17 # define        ADD     268
18 # define        ADDX    269
19 # define        EXTRACT 270
20 # define        LIST    271
21 # define        DELETE  272
22 # define        DELETEX 273
23 # define        PWD     274
24 # define        CLEAR   275
25 # define        HELP    276
26 # define        LCD     277
27 # define        LPWD    278
28 # define        MODE    279
29 # define        SMB     280
30 # define        TAR     281
31 # define        PATH    282
32 # define        DATE    283
33
34 #line 31 "uparse.y"
35
36 #include "amanda.h"
37 #include "amrecover.h"
38
39 void yyerror P((char *s));
40 extern int yylex P((void));
41
42 #line 40 "uparse.y"
43 #ifndef YYSTYPE
44 typedef union {
45   int intval;
46   double floatval;
47   char *strval;
48   int subtok;
49 } yystype;
50 # define YYSTYPE yystype
51 # define YYSTYPE_IS_TRIVIAL 1
52 #endif
53 #ifndef YYDEBUG
54 # define YYDEBUG 0
55 #endif
56
57
58
59 #define YYFINAL         60
60 #define YYFLAG          -32768
61 #define YYNTBASE        30
62
63 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
64 #define YYTRANSLATE(x) ((unsigned)(x) <= 283 ? yytranslate[x] : 45)
65
66 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
67 static const char yytranslate[] =
68 {
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,
97       26,    27,    28,    29
98 };
99
100 #if YYDEBUG
101 static const short yyprhs[] =
102 {
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
108 };
109 static const short yyrhs[] =
110 {
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,
122        0,    16,     0
123 };
124
125 #endif
126
127 #if YYDEBUG
128 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
129 static const short yyrline[] =
130 {
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
136 };
137 #endif
138
139
140 #if (YYDEBUG) || defined YYERROR_VERBOSE
141
142 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
143 static const char *const yytname[] =
144 {
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", 
152   "extract_command", 0
153 };
154 #endif
155
156 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
157 static const short yyr1[] =
158 {
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
164 };
165
166 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
167 static const short yyr2[] =
168 {
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,
173        2,     2,     1,     1,     2,     1,     1
174 };
175
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
178    error. */
179 static const short yydefact[] =
180 {
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,
187        0
188 };
189
190 static const short yydefgoto[] =
191 {
192       58,    24,    25,    26,    27,    44,    28,    46,    29,    49,
193       30,    51,    31,    32,    33
194 };
195
196 static const short yypact[] =
197 {
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,
204   -32768
205 };
206
207 static const short yypgoto[] =
208 {
209   -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
210   -32768,-32768,-32768,-32768,-32768
211 };
212
213
214 #define YYLAST          44
215
216
217 static const short yytable[] =
218 {
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,
223       53,    54,    55,    56,    57
224 };
225
226 static const short yycheck[] =
227 {
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,
232       28,    28,    28,    28,    28
233 };
234 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
235 #line 3 "/usr/share/bison/bison.simple"
236
237 /* Skeleton output parser for bison,
238
239    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
240    Foundation, Inc.
241
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)
245    any later version.
246
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.
251
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.  */
256
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.  */
261
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.  */
266
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.  */
273
274 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
275
276 /* The parser invokes alloca or malloc; define the necessary symbols.  */
277
278 # if YYSTACK_USE_ALLOCA
279 #  define YYSTACK_ALLOC alloca
280 # else
281 #  ifndef YYSTACK_USE_ALLOCA
282 #   if defined (alloca) || defined (_ALLOCA_H)
283 #    define YYSTACK_ALLOC alloca
284 #   else
285 #    ifdef __GNUC__
286 #     define YYSTACK_ALLOC __builtin_alloca
287 #    endif
288 #   endif
289 #  endif
290 # endif
291
292 # ifdef YYSTACK_ALLOC
293    /* Pacify GCC's `empty if-body' warning. */
294 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
295 # else
296 #  if defined (__STDC__) || defined (__cplusplus)
297 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
298 #   define YYSIZE_T size_t
299 #  endif
300 #  define YYSTACK_ALLOC malloc
301 #  define YYSTACK_FREE free
302 # endif
303 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
304
305
306 #if (! defined (yyoverflow) \
307      && (! defined (__cplusplus) \
308          || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
309
310 /* A type that is properly aligned for any stack member.  */
311 union yyalloc
312 {
313   short yyss;
314   YYSTYPE yyvs;
315 # if YYLSP_NEEDED
316   YYLTYPE yyls;
317 # endif
318 };
319
320 /* The size of the maximum gap between one aligned stack and the next.  */
321 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
322
323 /* The size of an array large to enough to hold all stacks, each with
324    N elements.  */
325 # if YYLSP_NEEDED
326 #  define YYSTACK_BYTES(N) \
327      ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE))      \
328       + 2 * YYSTACK_GAP_MAX)
329 # else
330 #  define YYSTACK_BYTES(N) \
331      ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
332       + YYSTACK_GAP_MAX)
333 # endif
334
335 /* Copy COUNT objects from FROM to TO.  The source and destination do
336    not overlap.  */
337 # ifndef YYCOPY
338 #  if 1 < __GNUC__
339 #   define YYCOPY(To, From, Count) \
340       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
341 #  else
342 #   define YYCOPY(To, From, Count)              \
343       do                                        \
344         {                                       \
345           register YYSIZE_T yyi;                \
346           for (yyi = 0; yyi < (Count); yyi++)   \
347             (To)[yyi] = (From)[yyi];            \
348         }                                       \
349       while (0)
350 #  endif
351 # endif
352
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
357    stack.  */
358 # define YYSTACK_RELOCATE(Stack)                                        \
359     do                                                                  \
360       {                                                                 \
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);                          \
366       }                                                                 \
367     while (0)
368
369 #endif
370
371
372 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
373 # define YYSIZE_T __SIZE_TYPE__
374 #endif
375 #if ! defined (YYSIZE_T) && defined (size_t)
376 # define YYSIZE_T size_t
377 #endif
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
382 # endif
383 #endif
384 #if ! defined (YYSIZE_T)
385 # define YYSIZE_T unsigned int
386 #endif
387
388 #define yyerrok         (yyerrstatus = 0)
389 #define yyclearin       (yychar = YYEMPTY)
390 #define YYEMPTY         -2
391 #define YYEOF           0
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)                                  \
401 do                                                              \
402   if (yychar == YYEMPTY && yylen == 1)                          \
403     {                                                           \
404       yychar = (Token);                                         \
405       yylval = (Value);                                         \
406       yychar1 = YYTRANSLATE (yychar);                           \
407       YYPOPSTACK;                                               \
408       goto yybackup;                                            \
409     }                                                           \
410   else                                                          \
411     {                                                           \
412       yyerror ("syntax error: cannot back up");                 \
413       YYERROR;                                                  \
414     }                                                           \
415 while (0)
416
417 #define YYTERROR        1
418 #define YYERRCODE       256
419
420
421 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
422    are run).
423
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.  */
427
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;
432 #endif
433
434
435 /* YYLEX -- calling `yylex' with the right arguments.  */
436
437 #if YYPURE
438 # if YYLSP_NEEDED
439 #  ifdef YYLEX_PARAM
440 #   define YYLEX                yylex (&yylval, &yylloc, YYLEX_PARAM)
441 #  else
442 #   define YYLEX                yylex (&yylval, &yylloc)
443 #  endif
444 # else /* !YYLSP_NEEDED */
445 #  ifdef YYLEX_PARAM
446 #   define YYLEX                yylex (&yylval, YYLEX_PARAM)
447 #  else
448 #   define YYLEX                yylex (&yylval)
449 #  endif
450 # endif /* !YYLSP_NEEDED */
451 #else /* !YYPURE */
452 # define YYLEX                  yylex ()
453 #endif /* !YYPURE */
454
455
456 /* Enable debugging if requested.  */
457 #if YYDEBUG
458
459 # ifndef YYFPRINTF
460 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
461 #  define YYFPRINTF fprintf
462 # endif
463
464 # define YYDPRINTF(Args)                        \
465 do {                                            \
466   if (yydebug)                                  \
467     YYFPRINTF Args;                             \
468 } while (0)
469 /* Nonzero means print parse trace.  It is left uninitialized so that
470    multiple parsers can coexist.  */
471 int yydebug;
472 #else /* !YYDEBUG */
473 # define YYDPRINTF(Args)
474 #endif /* !YYDEBUG */
475
476 /* YYINITDEPTH -- initial size of the parser's stacks.  */
477 #ifndef YYINITDEPTH
478 # define YYINITDEPTH 200
479 #endif
480
481 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
482    if the built-in stack extension method is used).
483
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.  */
487
488 #if YYMAXDEPTH == 0
489 # undef YYMAXDEPTH
490 #endif
491
492 #ifndef YYMAXDEPTH
493 # define YYMAXDEPTH 10000
494 #endif
495 \f
496 #ifdef YYERROR_VERBOSE
497
498 # ifndef yystrlen
499 #  if defined (__GLIBC__) && defined (_STRING_H)
500 #   define yystrlen strlen
501 #  else
502 /* Return the length of YYSTR.  */
503 static YYSIZE_T
504 #   if defined (__STDC__) || defined (__cplusplus)
505 yystrlen (const char *yystr)
506 #   else
507 yystrlen (yystr)
508      const char *yystr;
509 #   endif
510 {
511   register const char *yys = yystr;
512
513   while (*yys++ != '\0')
514     continue;
515
516   return yys - yystr - 1;
517 }
518 #  endif
519 # endif
520
521 # ifndef yystpcpy
522 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
523 #   define yystpcpy stpcpy
524 #  else
525 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
526    YYDEST.  */
527 static char *
528 #   if defined (__STDC__) || defined (__cplusplus)
529 yystpcpy (char *yydest, const char *yysrc)
530 #   else
531 yystpcpy (yydest, yysrc)
532      char *yydest;
533      const char *yysrc;
534 #   endif
535 {
536   register char *yyd = yydest;
537   register const char *yys = yysrc;
538
539   while ((*yyd++ = *yys++) != '\0')
540     continue;
541
542   return yyd - 1;
543 }
544 #  endif
545 # endif
546 #endif
547 \f
548 #line 315 "/usr/share/bison/bison.simple"
549
550
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.  */
556
557 #ifdef YYPARSE_PARAM
558 # if defined (__STDC__) || defined (__cplusplus)
559 #  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
560 #  define YYPARSE_PARAM_DECL
561 # else
562 #  define YYPARSE_PARAM_ARG YYPARSE_PARAM
563 #  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
564 # endif
565 #else /* !YYPARSE_PARAM */
566 # define YYPARSE_PARAM_ARG
567 # define YYPARSE_PARAM_DECL
568 #endif /* !YYPARSE_PARAM */
569
570 /* Prevent warning if -Wstrict-prototypes.  */
571 #ifdef __GNUC__
572 # ifdef YYPARSE_PARAM
573 int yyparse (void *);
574 # else
575 int yyparse (void);
576 # endif
577 #endif
578
579 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
580    variables are global, or local to YYPARSE.  */
581
582 #define YY_DECL_NON_LSP_VARIABLES                       \
583 /* The lookahead symbol.  */                            \
584 int yychar;                                             \
585                                                         \
586 /* The semantic value of the lookahead symbol. */       \
587 YYSTYPE yylval;                                         \
588                                                         \
589 /* Number of parse errors so far.  */                   \
590 int yynerrs;
591
592 #if YYLSP_NEEDED
593 # define YY_DECL_VARIABLES                      \
594 YY_DECL_NON_LSP_VARIABLES                       \
595                                                 \
596 /* Location data for the lookahead symbol.  */  \
597 YYLTYPE yylloc;
598 #else
599 # define YY_DECL_VARIABLES                      \
600 YY_DECL_NON_LSP_VARIABLES
601 #endif
602
603
604 /* If nonreentrant, generate the variables here. */
605
606 #if !YYPURE
607 YY_DECL_VARIABLES
608 #endif  /* !YYPURE */
609
610 int
611 yyparse (YYPARSE_PARAM_ARG)
612      YYPARSE_PARAM_DECL
613 {
614   /* If reentrant, generate the variables here. */
615 #if YYPURE
616   YY_DECL_VARIABLES
617 #endif  /* !YYPURE */
618
619   register int yystate;
620   register int yyn;
621   int yyresult;
622   /* Number of tokens to shift before error messages enabled.  */
623   int yyerrstatus;
624   /* Lookahead token as an internal (translated) token number.  */
625   int yychar1 = 0;
626
627   /* Three stacks and their tools:
628      `yyss': related to states,
629      `yyvs': related to semantic values,
630      `yyls': related to locations.
631
632      Refer to the stacks thru separate pointers, to allow yyoverflow
633      to reallocate them elsewhere.  */
634
635   /* The state stack. */
636   short yyssa[YYINITDEPTH];
637   short *yyss = yyssa;
638   register short *yyssp;
639
640   /* The semantic value stack.  */
641   YYSTYPE yyvsa[YYINITDEPTH];
642   YYSTYPE *yyvs = yyvsa;
643   register YYSTYPE *yyvsp;
644
645 #if YYLSP_NEEDED
646   /* The location stack.  */
647   YYLTYPE yylsa[YYINITDEPTH];
648   YYLTYPE *yyls = yylsa;
649   YYLTYPE *yylsp;
650 #endif
651
652 #if YYLSP_NEEDED
653 # define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
654 #else
655 # define YYPOPSTACK   (yyvsp--, yyssp--)
656 #endif
657
658   YYSIZE_T yystacksize = YYINITDEPTH;
659
660
661   /* The variables used to return semantic value and location from the
662      action routines.  */
663   YYSTYPE yyval;
664 #if YYLSP_NEEDED
665   YYLTYPE yyloc;
666 #endif
667
668   /* When reducing, the number of symbols on the RHS of the reduced
669      rule. */
670   int yylen;
671
672   YYDPRINTF ((stderr, "Starting parse\n"));
673
674   yystate = 0;
675   yyerrstatus = 0;
676   yynerrs = 0;
677   yychar = YYEMPTY;             /* Cause a token to be read.  */
678
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.  */
683
684   yyssp = yyss;
685   yyvsp = yyvs;
686 #if YYLSP_NEEDED
687   yylsp = yyls;
688 #endif
689   goto yysetstate;
690
691 /*------------------------------------------------------------.
692 | yynewstate -- Push a new state, which is found in yystate.  |
693 `------------------------------------------------------------*/
694  yynewstate:
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.
697      */
698   yyssp++;
699
700  yysetstate:
701   *yyssp = yystate;
702
703   if (yyssp >= yyss + yystacksize - 1)
704     {
705       /* Get the current used size of the three stacks, in elements.  */
706       YYSIZE_T yysize = yyssp - yyss + 1;
707
708 #ifdef yyoverflow
709       {
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
712            memory.  */
713         YYSTYPE *yyvs1 = yyvs;
714         short *yyss1 = yyss;
715
716         /* Each stack pointer address is followed by the size of the
717            data in use in that stack, in bytes.  */
718 # if YYLSP_NEEDED
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),
726                     &yystacksize);
727         yyls = yyls1;
728 # else
729         yyoverflow ("parser stack overflow",
730                     &yyss1, yysize * sizeof (*yyssp),
731                     &yyvs1, yysize * sizeof (*yyvsp),
732                     &yystacksize);
733 # endif
734         yyss = yyss1;
735         yyvs = yyvs1;
736       }
737 #else /* no yyoverflow */
738 # ifndef YYSTACK_RELOCATE
739       goto yyoverflowlab;
740 # else
741       /* Extend the stack our own way.  */
742       if (yystacksize >= YYMAXDEPTH)
743         goto yyoverflowlab;
744       yystacksize *= 2;
745       if (yystacksize > YYMAXDEPTH)
746         yystacksize = YYMAXDEPTH;
747
748       {
749         short *yyss1 = yyss;
750         union yyalloc *yyptr =
751           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
752         if (! yyptr)
753           goto yyoverflowlab;
754         YYSTACK_RELOCATE (yyss);
755         YYSTACK_RELOCATE (yyvs);
756 # if YYLSP_NEEDED
757         YYSTACK_RELOCATE (yyls);
758 # endif
759 # undef YYSTACK_RELOCATE
760         if (yyss1 != yyssa)
761           YYSTACK_FREE (yyss1);
762       }
763 # endif
764 #endif /* no yyoverflow */
765
766       yyssp = yyss + yysize - 1;
767       yyvsp = yyvs + yysize - 1;
768 #if YYLSP_NEEDED
769       yylsp = yyls + yysize - 1;
770 #endif
771
772       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
773                   (unsigned long int) yystacksize));
774
775       if (yyssp >= yyss + yystacksize - 1)
776         YYABORT;
777     }
778
779   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
780
781   goto yybackup;
782
783
784 /*-----------.
785 | yybackup.  |
786 `-----------*/
787 yybackup:
788
789 /* Do appropriate processing given the current state.  */
790 /* Read a lookahead token if we need one and don't already have one.  */
791 /* yyresume: */
792
793   /* First try to decide what to do without reference to lookahead token.  */
794
795   yyn = yypact[yystate];
796   if (yyn == YYFLAG)
797     goto yydefault;
798
799   /* Not known => get a lookahead token if don't already have one.  */
800
801   /* yychar is either YYEMPTY or YYEOF
802      or a valid token in external form.  */
803
804   if (yychar == YYEMPTY)
805     {
806       YYDPRINTF ((stderr, "Reading a token: "));
807       yychar = YYLEX;
808     }
809
810   /* Convert token to internal form (in yychar1) for indexing tables with */
811
812   if (yychar <= 0)              /* This means end of input. */
813     {
814       yychar1 = 0;
815       yychar = YYEOF;           /* Don't call YYLEX any more */
816
817       YYDPRINTF ((stderr, "Now at end of input.\n"));
818     }
819   else
820     {
821       yychar1 = YYTRANSLATE (yychar);
822
823 #if YYDEBUG
824      /* We have to keep this `#if YYDEBUG', since we use variables
825         which are defined only if `YYDEBUG' is set.  */
826       if (yydebug)
827         {
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.  */
832 # ifdef YYPRINT
833           YYPRINT (stderr, yychar, yylval);
834 # endif
835           YYFPRINTF (stderr, ")\n");
836         }
837 #endif
838     }
839
840   yyn += yychar1;
841   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
842     goto yydefault;
843
844   yyn = yytable[yyn];
845
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,
850        just return success.
851      0, or most negative number => error.  */
852
853   if (yyn < 0)
854     {
855       if (yyn == YYFLAG)
856         goto yyerrlab;
857       yyn = -yyn;
858       goto yyreduce;
859     }
860   else if (yyn == 0)
861     goto yyerrlab;
862
863   if (yyn == YYFINAL)
864     YYACCEPT;
865
866   /* Shift the lookahead token.  */
867   YYDPRINTF ((stderr, "Shifting token %d (%s), ",
868               yychar, yytname[yychar1]));
869
870   /* Discard the token being shifted unless it is eof.  */
871   if (yychar != YYEOF)
872     yychar = YYEMPTY;
873
874   *++yyvsp = yylval;
875 #if YYLSP_NEEDED
876   *++yylsp = yylloc;
877 #endif
878
879   /* Count tokens shifted since error; after three, turn off error
880      status.  */
881   if (yyerrstatus)
882     yyerrstatus--;
883
884   yystate = yyn;
885   goto yynewstate;
886
887
888 /*-----------------------------------------------------------.
889 | yydefault -- do the default action for the current state.  |
890 `-----------------------------------------------------------*/
891 yydefault:
892   yyn = yydefact[yystate];
893   if (yyn == 0)
894     goto yyerrlab;
895   goto yyreduce;
896
897
898 /*-----------------------------.
899 | yyreduce -- Do a reduction.  |
900 `-----------------------------*/
901 yyreduce:
902   /* yyn is the number of a rule to reduce with.  */
903   yylen = yyr2[yyn];
904
905   /* If YYLEN is nonzero, implement the default value of the action:
906      `$$ = $1'.
907
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];
914
915 #if YYLSP_NEEDED
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);
920 #endif
921
922 #if YYDEBUG
923   /* We have to keep this `#if YYDEBUG', since we use variables which
924      are defined only if `YYDEBUG' is set.  */
925   if (yydebug)
926     {
927       int yyi;
928
929       YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
930                  yyn, yyrline[yyn]);
931
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]]);
936     }
937 #endif
938
939   switch (yyn) {
940
941 case 11:
942 #line 76 "uparse.y"
943 { list_disk(yyvsp[0].strval); amfree(yyvsp[0].strval); }
944     break;
945 case 12:
946 #line 77 "uparse.y"
947 { list_disk(NULL); }
948     break;
949 case 13:
950 #line 78 "uparse.y"
951 { set_date(yyvsp[0].strval); amfree(yyvsp[0].strval); }
952     break;
953 case 14:
954 #line 79 "uparse.y"
955 { set_host(yyvsp[0].strval); amfree(yyvsp[0].strval); }
956     break;
957 case 15:
958 #line 80 "uparse.y"
959 { set_disk(yyvsp[-1].strval, yyvsp[0].strval); amfree(yyvsp[-1].strval); amfree(yyvsp[0].strval); }
960     break;
961 case 16:
962 #line 81 "uparse.y"
963 { set_disk(yyvsp[0].strval, NULL); amfree(yyvsp[0].strval); }
964     break;
965 case 17:
966 #line 82 "uparse.y"
967 { set_tape(yyvsp[0].strval); amfree(yyvsp[0].strval); }
968     break;
969 case 18:
970 #line 83 "uparse.y"
971 { set_tape(""); }
972     break;
973 case 19:
974 #line 84 "uparse.y"
975 { cd_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
976     break;
977 case 20:
978 #line 85 "uparse.y"
979 { cd_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
980     break;
981 case 21:
982 #line 86 "uparse.y"
983 {
984 #ifdef SAMBA_CLIENT
985                          set_mode(SAMBA_SMBCLIENT);
986 #endif /* SAMBA_CLIENT */
987                     }
988     break;
989 case 22:
990 #line 91 "uparse.y"
991 {
992 #ifdef SAMBA_CLIENT
993                          set_mode(SAMBA_TAR);
994 #endif /* SAMBA_CLIENT */
995                     }
996     break;
997 case 23:
998 #line 99 "uparse.y"
999 { list_disk_history(); }
1000     break;
1001 case 24:
1002 #line 100 "uparse.y"
1003 { list_directory(); }
1004     break;
1005 case 25:
1006 #line 101 "uparse.y"
1007 { display_extract_list(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1008     break;
1009 case 26:
1010 #line 102 "uparse.y"
1011 { display_extract_list(NULL); }
1012     break;
1013 case 27:
1014 #line 103 "uparse.y"
1015 { show_directory(); }
1016     break;
1017 case 28:
1018 #line 104 "uparse.y"
1019 { clear_extract_list(); }
1020     break;
1021 case 29:
1022 #line 105 "uparse.y"
1023 { show_mode (); }
1024     break;
1025 case 30:
1026 #line 109 "uparse.y"
1027 { quit(); }
1028     break;
1029 case 32:
1030 #line 117 "uparse.y"
1031 { add_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1032     break;
1033 case 33:
1034 #line 118 "uparse.y"
1035 { add_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1036     break;
1037 case 35:
1038 #line 126 "uparse.y"
1039 { add_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1040     break;
1041 case 36:
1042 #line 127 "uparse.y"
1043 { add_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1044     break;
1045 case 38:
1046 #line 135 "uparse.y"
1047 { delete_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1048     break;
1049 case 39:
1050 #line 136 "uparse.y"
1051 { delete_glob(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1052     break;
1053 case 41:
1054 #line 144 "uparse.y"
1055 { delete_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1056     break;
1057 case 42:
1058 #line 145 "uparse.y"
1059 { delete_regex(yyvsp[0].strval); amfree(yyvsp[0].strval); }
1060     break;
1061 case 43:
1062 #line 149 "uparse.y"
1063 { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); }
1064     break;
1065 case 44:
1066 #line 150 "uparse.y"
1067 {
1068                 if (chdir(yyvsp[0].strval) == -1) {
1069                         perror(yyvsp[0].strval);
1070                 }
1071                 amfree(yyvsp[0].strval);
1072         }
1073     break;
1074 case 45:
1075 #line 159 "uparse.y"
1076 { help_list(); }
1077     break;
1078 case 46:
1079 #line 163 "uparse.y"
1080 { extract_files(); }
1081     break;
1082 }
1083
1084 #line 705 "/usr/share/bison/bison.simple"
1085
1086 \f
1087   yyvsp -= yylen;
1088   yyssp -= yylen;
1089 #if YYLSP_NEEDED
1090   yylsp -= yylen;
1091 #endif
1092
1093 #if YYDEBUG
1094   if (yydebug)
1095     {
1096       short *yyssp1 = yyss - 1;
1097       YYFPRINTF (stderr, "state stack now");
1098       while (yyssp1 != yyssp)
1099         YYFPRINTF (stderr, " %d", *++yyssp1);
1100       YYFPRINTF (stderr, "\n");
1101     }
1102 #endif
1103
1104   *++yyvsp = yyval;
1105 #if YYLSP_NEEDED
1106   *++yylsp = yyloc;
1107 #endif
1108
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.  */
1112
1113   yyn = yyr1[yyn];
1114
1115   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1116   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1117     yystate = yytable[yystate];
1118   else
1119     yystate = yydefgoto[yyn - YYNTBASE];
1120
1121   goto yynewstate;
1122
1123
1124 /*------------------------------------.
1125 | yyerrlab -- here on detecting error |
1126 `------------------------------------*/
1127 yyerrlab:
1128   /* If not already recovering from an error, report this error.  */
1129   if (!yyerrstatus)
1130     {
1131       ++yynerrs;
1132
1133 #ifdef YYERROR_VERBOSE
1134       yyn = yypact[yystate];
1135
1136       if (yyn > YYFLAG && yyn < YYLAST)
1137         {
1138           YYSIZE_T yysize = 0;
1139           char *yymsg;
1140           int yyx, yycount;
1141
1142           yycount = 0;
1143           /* Start YYX at -YYN if negative to avoid negative indexes in
1144              YYCHECK.  */
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);
1152           if (yymsg != 0)
1153             {
1154               char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1155               yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1156
1157               if (yycount < 5)
1158                 {
1159                   yycount = 0;
1160                   for (yyx = yyn < 0 ? -yyn : 0;
1161                        yyx < (int) (sizeof (yytname) / sizeof (char *));
1162                        yyx++)
1163                     if (yycheck[yyx + yyn] == yyx)
1164                       {
1165                         const char *yyq = ! yycount ? ", expecting " : " or ";
1166                         yyp = yystpcpy (yyp, yyq);
1167                         yyp = yystpcpy (yyp, yytname[yyx]);
1168                         yycount++;
1169                       }
1170                 }
1171               yyerror (yymsg);
1172               YYSTACK_FREE (yymsg);
1173             }
1174           else
1175             yyerror ("parse error; also virtual memory exhausted");
1176         }
1177       else
1178 #endif /* defined (YYERROR_VERBOSE) */
1179         yyerror ("parse error");
1180     }
1181   goto yyerrlab1;
1182
1183
1184 /*--------------------------------------------------.
1185 | yyerrlab1 -- error raised explicitly by an action |
1186 `--------------------------------------------------*/
1187 yyerrlab1:
1188   if (yyerrstatus == 3)
1189     {
1190       /* If just tried and failed to reuse lookahead token after an
1191          error, discard it.  */
1192
1193       /* return failure if at end of input */
1194       if (yychar == YYEOF)
1195         YYABORT;
1196       YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1197                   yychar, yytname[yychar1]));
1198       yychar = YYEMPTY;
1199     }
1200
1201   /* Else will try to reuse lookahead token after shifting the error
1202      token.  */
1203
1204   yyerrstatus = 3;              /* Each real token shifted decrements this */
1205
1206   goto yyerrhandle;
1207
1208
1209 /*-------------------------------------------------------------------.
1210 | yyerrdefault -- current state does not do anything special for the |
1211 | error token.                                                       |
1212 `-------------------------------------------------------------------*/
1213 yyerrdefault:
1214 #if 0
1215   /* This is wrong; only states that explicitly want error tokens
1216      should shift them.  */
1217
1218   /* If its default is to accept any token, ok.  Otherwise pop it.  */
1219   yyn = yydefact[yystate];
1220   if (yyn)
1221     goto yydefault;
1222 #endif
1223
1224
1225 /*---------------------------------------------------------------.
1226 | yyerrpop -- pop the current state because it cannot handle the |
1227 | error token                                                    |
1228 `---------------------------------------------------------------*/
1229 yyerrpop:
1230   if (yyssp == yyss)
1231     YYABORT;
1232   yyvsp--;
1233   yystate = *--yyssp;
1234 #if YYLSP_NEEDED
1235   yylsp--;
1236 #endif
1237
1238 #if YYDEBUG
1239   if (yydebug)
1240     {
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");
1246     }
1247 #endif
1248
1249 /*--------------.
1250 | yyerrhandle.  |
1251 `--------------*/
1252 yyerrhandle:
1253   yyn = yypact[yystate];
1254   if (yyn == YYFLAG)
1255     goto yyerrdefault;
1256
1257   yyn += YYTERROR;
1258   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1259     goto yyerrdefault;
1260
1261   yyn = yytable[yyn];
1262   if (yyn < 0)
1263     {
1264       if (yyn == YYFLAG)
1265         goto yyerrpop;
1266       yyn = -yyn;
1267       goto yyreduce;
1268     }
1269   else if (yyn == 0)
1270     goto yyerrpop;
1271
1272   if (yyn == YYFINAL)
1273     YYACCEPT;
1274
1275   YYDPRINTF ((stderr, "Shifting error token, "));
1276
1277   *++yyvsp = yylval;
1278 #if YYLSP_NEEDED
1279   *++yylsp = yylloc;
1280 #endif
1281
1282   yystate = yyn;
1283   goto yynewstate;
1284
1285
1286 /*-------------------------------------.
1287 | yyacceptlab -- YYACCEPT comes here.  |
1288 `-------------------------------------*/
1289 yyacceptlab:
1290   yyresult = 0;
1291   goto yyreturn;
1292
1293 /*-----------------------------------.
1294 | yyabortlab -- YYABORT comes here.  |
1295 `-----------------------------------*/
1296 yyabortlab:
1297   yyresult = 1;
1298   goto yyreturn;
1299
1300 /*---------------------------------------------.
1301 | yyoverflowab -- parser overflow comes here.  |
1302 `---------------------------------------------*/
1303 yyoverflowlab:
1304   yyerror ("parser stack overflow");
1305   yyresult = 2;
1306   /* Fall through.  */
1307
1308 yyreturn:
1309 #ifndef yyoverflow
1310   if (yyss != yyssa)
1311     YYSTACK_FREE (yyss);
1312 #endif
1313   return yyresult;
1314 }
1315 #line 167 "uparse.y"
1316
1317
1318 void yyerror(s)
1319 char *s;
1320 {
1321   printf("Invalid command - %s\n", s);
1322 }
1323
1324