Imported Upstream version 2.5.1
[debian/amanda] / recover-src / uparse.c
1 /* A Bison parser, made by GNU Bison 2.1.  */
2
3 /* Skeleton parser for Yacc-like parsing with Bison,
4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5
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)
9    any later version.
10
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.
15
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., 51 Franklin Street, Fifth Floor,
19    Boston, MA 02110-1301, USA.  */
20
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.  */
25
26 /* Written by Richard Stallman by simplifying the original so called
27    ``semantic'' parser.  */
28
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.  */
35
36 /* Identify Bison output.  */
37 #define YYBISON 1
38
39 /* Bison version.  */
40 #define YYBISON_VERSION "2.1"
41
42 /* Skeleton name.  */
43 #define YYSKELETON_NAME "yacc.c"
44
45 /* Pure parsers.  */
46 #define YYPURE 0
47
48 /* Using locations.  */
49 #define YYLSP_NEEDED 0
50
51
52
53 /* Tokens.  */
54 #ifndef YYTOKENTYPE
55 # define YYTOKENTYPE
56    /* Put the tokens into the symbol table, so that GDB and other debuggers
57       know about them.  */
58    enum yytokentype {
59      LISTHOST = 258,
60      LISTDISK = 259,
61      SETHOST = 260,
62      SETDISK = 261,
63      SETDATE = 262,
64      SETTAPE = 263,
65      SETMODE = 264,
66      CD = 265,
67      CDX = 266,
68      QUIT = 267,
69      DHIST = 268,
70      LS = 269,
71      ADD = 270,
72      ADDX = 271,
73      EXTRACT = 272,
74      LIST = 273,
75      DELETE = 274,
76      DELETEX = 275,
77      PWD = 276,
78      CLEAR = 277,
79      HELP = 278,
80      LCD = 279,
81      LPWD = 280,
82      MODE = 281,
83      SMB = 282,
84      TAR = 283,
85      PATH = 284,
86      DATE = 285
87    };
88 #endif
89 /* Tokens.  */
90 #define LISTHOST 258
91 #define LISTDISK 259
92 #define SETHOST 260
93 #define SETDISK 261
94 #define SETDATE 262
95 #define SETTAPE 263
96 #define SETMODE 264
97 #define CD 265
98 #define CDX 266
99 #define QUIT 267
100 #define DHIST 268
101 #define LS 269
102 #define ADD 270
103 #define ADDX 271
104 #define EXTRACT 272
105 #define LIST 273
106 #define DELETE 274
107 #define DELETEX 275
108 #define PWD 276
109 #define CLEAR 277
110 #define HELP 278
111 #define LCD 279
112 #define LPWD 280
113 #define MODE 281
114 #define SMB 282
115 #define TAR 283
116 #define PATH 284
117 #define DATE 285
118
119
120
121
122 /* Copy the first part of user declarations.  */
123 #line 31 "uparse.y"
124
125 #include "amanda.h"
126 #include "amrecover.h"
127
128 void            yyerror(char *s);
129 extern int      yylex(void);
130 extern char *   yytext;
131
132
133
134 /* Enabling traces.  */
135 #ifndef YYDEBUG
136 # define YYDEBUG 0
137 #endif
138
139 /* Enabling verbose error messages.  */
140 #ifdef YYERROR_VERBOSE
141 # undef YYERROR_VERBOSE
142 # define YYERROR_VERBOSE 1
143 #else
144 # define YYERROR_VERBOSE 0
145 #endif
146
147 /* Enabling the token table.  */
148 #ifndef YYTOKEN_TABLE
149 # define YYTOKEN_TABLE 0
150 #endif
151
152 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
153 #line 42 "uparse.y"
154 typedef union YYSTYPE {
155         int     intval;
156         double  floatval;
157         char *  strval;
158         int     subtok;
159 } YYSTYPE;
160 /* Line 196 of yacc.c.  */
161 #line 162 "uparse.c"
162 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
163 # define YYSTYPE_IS_DECLARED 1
164 # define YYSTYPE_IS_TRIVIAL 1
165 #endif
166
167
168
169 /* Copy the second part of user declarations.  */
170
171
172 /* Line 219 of yacc.c.  */
173 #line 174 "uparse.c"
174
175 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
176 # define YYSIZE_T __SIZE_TYPE__
177 #endif
178 #if ! defined (YYSIZE_T) && defined (size_t)
179 # define YYSIZE_T size_t
180 #endif
181 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
182 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
183 # define YYSIZE_T size_t
184 #endif
185 #if ! defined (YYSIZE_T)
186 # define YYSIZE_T unsigned int
187 #endif
188
189 #ifndef YY_
190 # if YYENABLE_NLS
191 #  if ENABLE_NLS
192 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
193 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
194 #  endif
195 # endif
196 # ifndef YY_
197 #  define YY_(msgid) msgid
198 # endif
199 #endif
200
201 #if ! defined (yyoverflow) || YYERROR_VERBOSE
202
203 /* The parser invokes alloca or malloc; define the necessary symbols.  */
204
205 # ifdef YYSTACK_USE_ALLOCA
206 #  if YYSTACK_USE_ALLOCA
207 #   ifdef __GNUC__
208 #    define YYSTACK_ALLOC __builtin_alloca
209 #   else
210 #    define YYSTACK_ALLOC alloca
211 #    if defined (__STDC__) || defined (__cplusplus)
212 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
213 #     define YYINCLUDED_STDLIB_H
214 #    endif
215 #   endif
216 #  endif
217 # endif
218
219 # ifdef YYSTACK_ALLOC
220    /* Pacify GCC's `empty if-body' warning. */
221 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
222 #  ifndef YYSTACK_ALLOC_MAXIMUM
223     /* The OS might guarantee only one guard page at the bottom of the stack,
224        and a page size can be as small as 4096 bytes.  So we cannot safely
225        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
226        to allow for a few compiler-allocated temporary stack slots.  */
227 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
228 #  endif
229 # else
230 #  define YYSTACK_ALLOC YYMALLOC
231 #  define YYSTACK_FREE YYFREE
232 #  ifndef YYSTACK_ALLOC_MAXIMUM
233 #   define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
234 #  endif
235 #  ifdef __cplusplus
236 extern "C" {
237 #  endif
238 #  ifndef YYMALLOC
239 #   define YYMALLOC malloc
240 #   if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
241         && (defined (__STDC__) || defined (__cplusplus)))
242 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
243 #   endif
244 #  endif
245 #  ifndef YYFREE
246 #   define YYFREE free
247 #   if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
248         && (defined (__STDC__) || defined (__cplusplus)))
249 void free (void *); /* INFRINGES ON USER NAME SPACE */
250 #   endif
251 #  endif
252 #  ifdef __cplusplus
253 }
254 #  endif
255 # endif
256 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
257
258
259 #if (! defined (yyoverflow) \
260      && (! defined (__cplusplus) \
261          || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
262
263 /* A type that is properly aligned for any stack member.  */
264 union yyalloc
265 {
266   short int yyss;
267   YYSTYPE yyvs;
268   };
269
270 /* The size of the maximum gap between one aligned stack and the next.  */
271 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
272
273 /* The size of an array large to enough to hold all stacks, each with
274    N elements.  */
275 # define YYSTACK_BYTES(N) \
276      ((N) * (sizeof (short int) + sizeof (YYSTYPE))                     \
277       + YYSTACK_GAP_MAXIMUM)
278
279 /* Copy COUNT objects from FROM to TO.  The source and destination do
280    not overlap.  */
281 # ifndef YYCOPY
282 #  if defined (__GNUC__) && 1 < __GNUC__
283 #   define YYCOPY(To, From, Count) \
284       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
285 #  else
286 #   define YYCOPY(To, From, Count)              \
287       do                                        \
288         {                                       \
289           YYSIZE_T yyi;                         \
290           for (yyi = 0; yyi < (Count); yyi++)   \
291             (To)[yyi] = (From)[yyi];            \
292         }                                       \
293       while (0)
294 #  endif
295 # endif
296
297 /* Relocate STACK from its old location to the new one.  The
298    local variables YYSIZE and YYSTACKSIZE give the old and new number of
299    elements in the stack, and YYPTR gives the new location of the
300    stack.  Advance YYPTR to a properly aligned location for the next
301    stack.  */
302 # define YYSTACK_RELOCATE(Stack)                                        \
303     do                                                                  \
304       {                                                                 \
305         YYSIZE_T yynewbytes;                                            \
306         YYCOPY (&yyptr->Stack, Stack, yysize);                          \
307         Stack = &yyptr->Stack;                                          \
308         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
309         yyptr += yynewbytes / sizeof (*yyptr);                          \
310       }                                                                 \
311     while (0)
312
313 #endif
314
315 #if defined (__STDC__) || defined (__cplusplus)
316    typedef signed char yysigned_char;
317 #else
318    typedef short int yysigned_char;
319 #endif
320
321 /* YYFINAL -- State number of the termination state. */
322 #define YYFINAL  55
323 /* YYLAST -- Last index in YYTABLE.  */
324 #define YYLAST   45
325
326 /* YYNTOKENS -- Number of terminals. */
327 #define YYNTOKENS  31
328 /* YYNNTS -- Number of nonterminals. */
329 #define YYNNTS  16
330 /* YYNRULES -- Number of rules. */
331 #define YYNRULES  49
332 /* YYNRULES -- Number of states. */
333 #define YYNSTATES  61
334
335 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
336 #define YYUNDEFTOK  2
337 #define YYMAXUTOK   285
338
339 #define YYTRANSLATE(YYX)                                                \
340   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
341
342 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
343 static const unsigned char yytranslate[] =
344 {
345        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
346        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
347        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
348        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
349        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
350        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
351        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
352        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
353        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
354        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
355        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
356        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
357        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
358        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
359        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
360        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
361        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
362        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
363        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
364        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
365        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
366        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
367        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
368        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
369        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
370        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
371        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
372       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
373       25,    26,    27,    28,    29,    30
374 };
375
376 #if YYDEBUG
377 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
378    YYRHS.  */
379 static const unsigned char yyprhs[] =
380 {
381        0,     0,     3,     5,     7,     9,    11,    13,    15,    17,
382       19,    21,    23,    24,    26,    29,    31,    34,    37,    41,
383       44,    47,    49,    52,    55,    58,    61,    63,    65,    68,
384       70,    72,    74,    76,    78,    81,    84,    86,    89,    92,
385       94,    97,   100,   102,   105,   108,   110,   112,   115,   117
386 };
387
388 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
389 static const yysigned_char yyrhs[] =
390 {
391       32,     0,    -1,    33,    -1,    34,    -1,    35,    -1,    36,
392       -1,    38,    -1,    40,    -1,    42,    -1,    44,    -1,    45,
393       -1,    46,    -1,    -1,     3,    -1,     4,    29,    -1,     4,
394       -1,     7,    30,    -1,     5,    29,    -1,     6,    29,    29,
395       -1,     6,    29,    -1,     8,    29,    -1,     8,    -1,    10,
396       29,    -1,    11,    29,    -1,     9,    27,    -1,     9,    28,
397       -1,    13,    -1,    14,    -1,    18,    29,    -1,    18,    -1,
398       21,    -1,    22,    -1,    26,    -1,    12,    -1,    15,    37,
399       -1,    37,    29,    -1,    29,    -1,    16,    39,    -1,    39,
400       29,    -1,    29,    -1,    19,    41,    -1,    41,    29,    -1,
401       29,    -1,    20,    43,    -1,    43,    29,    -1,    29,    -1,
402       25,    -1,    24,    29,    -1,    23,    -1,    17,    -1
403 };
404
405 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
406 static const unsigned char yyrline[] =
407 {
408        0,    65,    65,    66,    67,    68,    69,    70,    71,    72,
409       73,    74,    75,    84,    85,    86,    87,    88,    89,    90,
410       91,    92,    93,    94,    95,   100,   108,   109,   110,   111,
411      112,   113,   114,   118,   122,   126,   127,   131,   135,   136,
412      140,   144,   145,   149,   153,   154,   158,   159,   168,   172
413 };
414 #endif
415
416 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
417 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
418    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
419 static const char *const yytname[] =
420 {
421   "$end", "error", "$undefined", "LISTHOST", "LISTDISK", "SETHOST",
422   "SETDISK", "SETDATE", "SETTAPE", "SETMODE", "CD", "CDX", "QUIT", "DHIST",
423   "LS", "ADD", "ADDX", "EXTRACT", "LIST", "DELETE", "DELETEX", "PWD",
424   "CLEAR", "HELP", "LCD", "LPWD", "MODE", "SMB", "TAR", "PATH", "DATE",
425   "$accept", "ucommand", "set_command", "display_command", "quit_command",
426   "add_command", "add_path", "addx_command", "addx_path", "delete_command",
427   "delete_path", "deletex_command", "deletex_path", "local_command",
428   "help_command", "extract_command", 0
429 };
430 #endif
431
432 # ifdef YYPRINT
433 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
434    token YYLEX-NUM.  */
435 static const unsigned short int yytoknum[] =
436 {
437        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
438      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
439      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
440      285
441 };
442 # endif
443
444 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
445 static const unsigned char yyr1[] =
446 {
447        0,    31,    32,    32,    32,    32,    32,    32,    32,    32,
448       32,    32,    32,    33,    33,    33,    33,    33,    33,    33,
449       33,    33,    33,    33,    33,    33,    34,    34,    34,    34,
450       34,    34,    34,    35,    36,    37,    37,    38,    39,    39,
451       40,    41,    41,    42,    43,    43,    44,    44,    45,    46
452 };
453
454 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
455 static const unsigned char yyr2[] =
456 {
457        0,     2,     1,     1,     1,     1,     1,     1,     1,     1,
458        1,     1,     0,     1,     2,     1,     2,     2,     3,     2,
459        2,     1,     2,     2,     2,     2,     1,     1,     2,     1,
460        1,     1,     1,     1,     2,     2,     1,     2,     2,     1,
461        2,     2,     1,     2,     2,     1,     1,     2,     1,     1
462 };
463
464 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
465    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
466    means the default is an error.  */
467 static const unsigned char yydefact[] =
468 {
469       12,    13,    15,     0,     0,     0,    21,     0,     0,     0,
470       33,    26,    27,     0,     0,    49,    29,     0,     0,    30,
471       31,    48,     0,    46,    32,     0,     2,     3,     4,     5,
472        6,     7,     8,     9,    10,    11,    14,    17,    19,    16,
473       20,    24,    25,    22,    23,    36,    34,    39,    37,    28,
474       42,    40,    45,    43,    47,     1,    18,    35,    38,    41,
475       44
476 };
477
478 /* YYDEFGOTO[NTERM-NUM]. */
479 static const yysigned_char yydefgoto[] =
480 {
481       -1,    25,    26,    27,    28,    29,    46,    30,    48,    31,
482       51,    32,    53,    33,    34,    35
483 };
484
485 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
486    STATE-NUM.  */
487 #define YYPACT_NINF -6
488 static const yysigned_char yypact[] =
489 {
490       -3,    -6,    -5,    -1,     0,     1,     3,    -2,     4,     5,
491       -6,    -6,    -6,     6,     7,    -6,     8,     9,    10,    -6,
492       -6,    -6,    11,    -6,    -6,    27,    -6,    -6,    -6,    -6,
493       -6,    -6,    -6,    -6,    -6,    -6,    -6,    -6,    12,    -6,
494       -6,    -6,    -6,    -6,    -6,    -6,    13,    -6,    14,    -6,
495       -6,    15,    -6,    16,    -6,    -6,    -6,    -6,    -6,    -6,
496       -6
497 };
498
499 /* YYPGOTO[NTERM-NUM].  */
500 static const yysigned_char yypgoto[] =
501 {
502       -6,    -6,    -6,    -6,    -6,    -6,    -6,    -6,    -6,    -6,
503       -6,    -6,    -6,    -6,    -6,    -6
504 };
505
506 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
507    positive, shift that token.  If negative, reduce the rule which
508    number is the opposite.  If zero, do what YYDEFACT says.
509    If YYTABLE_NINF, syntax error.  */
510 #define YYTABLE_NINF -1
511 static const unsigned char yytable[] =
512 {
513        1,     2,     3,     4,     5,     6,     7,     8,     9,    10,
514       11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
515       21,    22,    23,    24,    36,    41,    42,    55,    37,    38,
516        0,    39,    40,    43,    44,    45,    47,    49,    50,    52,
517       54,    56,    57,    58,    59,    60
518 };
519
520 static const yysigned_char yycheck[] =
521 {
522        3,     4,     5,     6,     7,     8,     9,    10,    11,    12,
523       13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
524       23,    24,    25,    26,    29,    27,    28,     0,    29,    29,
525       -1,    30,    29,    29,    29,    29,    29,    29,    29,    29,
526       29,    29,    29,    29,    29,    29
527 };
528
529 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
530    symbol of state STATE-NUM.  */
531 static const unsigned char yystos[] =
532 {
533        0,     3,     4,     5,     6,     7,     8,     9,    10,    11,
534       12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
535       22,    23,    24,    25,    26,    32,    33,    34,    35,    36,
536       38,    40,    42,    44,    45,    46,    29,    29,    29,    30,
537       29,    27,    28,    29,    29,    29,    37,    29,    39,    29,
538       29,    41,    29,    43,    29,     0,    29,    29,    29,    29,
539       29
540 };
541
542 #define yyerrok         (yyerrstatus = 0)
543 #define yyclearin       (yychar = YYEMPTY)
544 #define YYEMPTY         (-2)
545 #define YYEOF           0
546
547 #define YYACCEPT        goto yyacceptlab
548 #define YYABORT         goto yyabortlab
549 #define YYERROR         goto yyerrorlab
550
551
552 /* Like YYERROR except do call yyerror.  This remains here temporarily
553    to ease the transition to the new meaning of YYERROR, for GCC.
554    Once GCC version 2 has supplanted version 1, this can go.  */
555
556 #define YYFAIL          goto yyerrlab
557
558 #define YYRECOVERING()  (!!yyerrstatus)
559
560 #define YYBACKUP(Token, Value)                                  \
561 do                                                              \
562   if (yychar == YYEMPTY && yylen == 1)                          \
563     {                                                           \
564       yychar = (Token);                                         \
565       yylval = (Value);                                         \
566       yytoken = YYTRANSLATE (yychar);                           \
567       YYPOPSTACK;                                               \
568       goto yybackup;                                            \
569     }                                                           \
570   else                                                          \
571     {                                                           \
572       yyerror (YY_("syntax error: cannot back up")); \
573       YYERROR;                                                  \
574     }                                                           \
575 while (0)
576
577
578 #define YYTERROR        1
579 #define YYERRCODE       256
580
581
582 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
583    If N is 0, then set CURRENT to the empty location which ends
584    the previous symbol: RHS[0] (always defined).  */
585
586 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
587 #ifndef YYLLOC_DEFAULT
588 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
589     do                                                                  \
590       if (N)                                                            \
591         {                                                               \
592           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
593           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
594           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
595           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
596         }                                                               \
597       else                                                              \
598         {                                                               \
599           (Current).first_line   = (Current).last_line   =              \
600             YYRHSLOC (Rhs, 0).last_line;                                \
601           (Current).first_column = (Current).last_column =              \
602             YYRHSLOC (Rhs, 0).last_column;                              \
603         }                                                               \
604     while (0)
605 #endif
606
607
608 /* YY_LOCATION_PRINT -- Print the location on the stream.
609    This macro was not mandated originally: define only if we know
610    we won't break user code: when these are the locations we know.  */
611
612 #ifndef YY_LOCATION_PRINT
613 # if YYLTYPE_IS_TRIVIAL
614 #  define YY_LOCATION_PRINT(File, Loc)                  \
615      fprintf (File, "%d.%d-%d.%d",                      \
616               (Loc).first_line, (Loc).first_column,     \
617               (Loc).last_line,  (Loc).last_column)
618 # else
619 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
620 # endif
621 #endif
622
623
624 /* YYLEX -- calling `yylex' with the right arguments.  */
625
626 #ifdef YYLEX_PARAM
627 # define YYLEX yylex (YYLEX_PARAM)
628 #else
629 # define YYLEX yylex ()
630 #endif
631
632 /* Enable debugging if requested.  */
633 #if YYDEBUG
634
635 # ifndef YYFPRINTF
636 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
637 #  define YYFPRINTF fprintf
638 # endif
639
640 # define YYDPRINTF(Args)                        \
641 do {                                            \
642   if (yydebug)                                  \
643     YYFPRINTF Args;                             \
644 } while (0)
645
646 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)          \
647 do {                                                            \
648   if (yydebug)                                                  \
649     {                                                           \
650       YYFPRINTF (stderr, "%s ", Title);                         \
651       yysymprint (stderr,                                       \
652                   Type, Value); \
653       YYFPRINTF (stderr, "\n");                                 \
654     }                                                           \
655 } while (0)
656
657 /*------------------------------------------------------------------.
658 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
659 | TOP (included).                                                   |
660 `------------------------------------------------------------------*/
661
662 #if defined (__STDC__) || defined (__cplusplus)
663 static void
664 yy_stack_print (short int *bottom, short int *top)
665 #else
666 static void
667 yy_stack_print (bottom, top)
668     short int *bottom;
669     short int *top;
670 #endif
671 {
672   YYFPRINTF (stderr, "Stack now");
673   for (/* Nothing. */; bottom <= top; ++bottom)
674     YYFPRINTF (stderr, " %d", *bottom);
675   YYFPRINTF (stderr, "\n");
676 }
677
678 # define YY_STACK_PRINT(Bottom, Top)                            \
679 do {                                                            \
680   if (yydebug)                                                  \
681     yy_stack_print ((Bottom), (Top));                           \
682 } while (0)
683
684
685 /*------------------------------------------------.
686 | Report that the YYRULE is going to be reduced.  |
687 `------------------------------------------------*/
688
689 #if defined (__STDC__) || defined (__cplusplus)
690 static void
691 yy_reduce_print (int yyrule)
692 #else
693 static void
694 yy_reduce_print (yyrule)
695     int yyrule;
696 #endif
697 {
698   int yyi;
699   unsigned long int yylno = yyrline[yyrule];
700   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
701              yyrule - 1, yylno);
702   /* Print the symbols being reduced, and their result.  */
703   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
704     YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
705   YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
706 }
707
708 # define YY_REDUCE_PRINT(Rule)          \
709 do {                                    \
710   if (yydebug)                          \
711     yy_reduce_print (Rule);             \
712 } while (0)
713
714 /* Nonzero means print parse trace.  It is left uninitialized so that
715    multiple parsers can coexist.  */
716 int yydebug;
717 #else /* !YYDEBUG */
718 # define YYDPRINTF(Args)
719 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
720 # define YY_STACK_PRINT(Bottom, Top)
721 # define YY_REDUCE_PRINT(Rule)
722 #endif /* !YYDEBUG */
723
724
725 /* YYINITDEPTH -- initial size of the parser's stacks.  */
726 #ifndef YYINITDEPTH
727 # define YYINITDEPTH 200
728 #endif
729
730 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
731    if the built-in stack extension method is used).
732
733    Do not make this value too large; the results are undefined if
734    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
735    evaluated with infinite-precision integer arithmetic.  */
736
737 #ifndef YYMAXDEPTH
738 # define YYMAXDEPTH 10000
739 #endif
740
741 \f
742
743 #if YYERROR_VERBOSE
744
745 # ifndef yystrlen
746 #  if defined (__GLIBC__) && defined (_STRING_H)
747 #   define yystrlen strlen
748 #  else
749 /* Return the length of YYSTR.  */
750 static YYSIZE_T
751 #   if defined (__STDC__) || defined (__cplusplus)
752 yystrlen (const char *yystr)
753 #   else
754 yystrlen (yystr)
755      const char *yystr;
756 #   endif
757 {
758   const char *yys = yystr;
759
760   while (*yys++ != '\0')
761     continue;
762
763   return yys - yystr - 1;
764 }
765 #  endif
766 # endif
767
768 # ifndef yystpcpy
769 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
770 #   define yystpcpy stpcpy
771 #  else
772 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
773    YYDEST.  */
774 static char *
775 #   if defined (__STDC__) || defined (__cplusplus)
776 yystpcpy (char *yydest, const char *yysrc)
777 #   else
778 yystpcpy (yydest, yysrc)
779      char *yydest;
780      const char *yysrc;
781 #   endif
782 {
783   char *yyd = yydest;
784   const char *yys = yysrc;
785
786   while ((*yyd++ = *yys++) != '\0')
787     continue;
788
789   return yyd - 1;
790 }
791 #  endif
792 # endif
793
794 # ifndef yytnamerr
795 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
796    quotes and backslashes, so that it's suitable for yyerror.  The
797    heuristic is that double-quoting is unnecessary unless the string
798    contains an apostrophe, a comma, or backslash (other than
799    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
800    null, do not copy; instead, return the length of what the result
801    would have been.  */
802 static YYSIZE_T
803 yytnamerr (char *yyres, const char *yystr)
804 {
805   if (*yystr == '"')
806     {
807       size_t yyn = 0;
808       char const *yyp = yystr;
809
810       for (;;)
811         switch (*++yyp)
812           {
813           case '\'':
814           case ',':
815             goto do_not_strip_quotes;
816
817           case '\\':
818             if (*++yyp != '\\')
819               goto do_not_strip_quotes;
820             /* Fall through.  */
821           default:
822             if (yyres)
823               yyres[yyn] = *yyp;
824             yyn++;
825             break;
826
827           case '"':
828             if (yyres)
829               yyres[yyn] = '\0';
830             return yyn;
831           }
832     do_not_strip_quotes: ;
833     }
834
835   if (! yyres)
836     return yystrlen (yystr);
837
838   return yystpcpy (yyres, yystr) - yyres;
839 }
840 # endif
841
842 #endif /* YYERROR_VERBOSE */
843
844 \f
845
846 #if YYDEBUG
847 /*--------------------------------.
848 | Print this symbol on YYOUTPUT.  |
849 `--------------------------------*/
850
851 #if defined (__STDC__) || defined (__cplusplus)
852 static void
853 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
854 #else
855 static void
856 yysymprint (yyoutput, yytype, yyvaluep)
857     FILE *yyoutput;
858     int yytype;
859     YYSTYPE *yyvaluep;
860 #endif
861 {
862   /* Pacify ``unused variable'' warnings.  */
863   (void) yyvaluep;
864
865   if (yytype < YYNTOKENS)
866     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
867   else
868     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
869
870
871 # ifdef YYPRINT
872   if (yytype < YYNTOKENS)
873     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
874 # endif
875   switch (yytype)
876     {
877       default:
878         break;
879     }
880   YYFPRINTF (yyoutput, ")");
881 }
882
883 #endif /* ! YYDEBUG */
884 /*-----------------------------------------------.
885 | Release the memory associated to this symbol.  |
886 `-----------------------------------------------*/
887
888 #if defined (__STDC__) || defined (__cplusplus)
889 static void
890 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
891 #else
892 static void
893 yydestruct (yymsg, yytype, yyvaluep)
894     const char *yymsg;
895     int yytype;
896     YYSTYPE *yyvaluep;
897 #endif
898 {
899   /* Pacify ``unused variable'' warnings.  */
900   (void) yyvaluep;
901
902   if (!yymsg)
903     yymsg = "Deleting";
904   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
905
906   switch (yytype)
907     {
908
909       default:
910         break;
911     }
912 }
913 \f
914
915 /* Prevent warnings from -Wmissing-prototypes.  */
916
917 #ifdef YYPARSE_PARAM
918 # if defined (__STDC__) || defined (__cplusplus)
919 int yyparse (void *YYPARSE_PARAM);
920 # else
921 int yyparse ();
922 # endif
923 #else /* ! YYPARSE_PARAM */
924 #if defined (__STDC__) || defined (__cplusplus)
925 int yyparse (void);
926 #else
927 int yyparse ();
928 #endif
929 #endif /* ! YYPARSE_PARAM */
930
931
932
933 /* The look-ahead symbol.  */
934 int yychar;
935
936 /* The semantic value of the look-ahead symbol.  */
937 YYSTYPE yylval;
938
939 /* Number of syntax errors so far.  */
940 int yynerrs;
941
942
943
944 /*----------.
945 | yyparse.  |
946 `----------*/
947
948 #ifdef YYPARSE_PARAM
949 # if defined (__STDC__) || defined (__cplusplus)
950 int yyparse (void *YYPARSE_PARAM)
951 # else
952 int yyparse (YYPARSE_PARAM)
953   void *YYPARSE_PARAM;
954 # endif
955 #else /* ! YYPARSE_PARAM */
956 #if defined (__STDC__) || defined (__cplusplus)
957 int
958 yyparse (void)
959 #else
960 int
961 yyparse ()
962
963 #endif
964 #endif
965 {
966   
967   int yystate;
968   int yyn;
969   int yyresult;
970   /* Number of tokens to shift before error messages enabled.  */
971   int yyerrstatus;
972   /* Look-ahead token as an internal (translated) token number.  */
973   int yytoken = 0;
974
975   /* Three stacks and their tools:
976      `yyss': related to states,
977      `yyvs': related to semantic values,
978      `yyls': related to locations.
979
980      Refer to the stacks thru separate pointers, to allow yyoverflow
981      to reallocate them elsewhere.  */
982
983   /* The state stack.  */
984   short int yyssa[YYINITDEPTH];
985   short int *yyss = yyssa;
986   short int *yyssp;
987
988   /* The semantic value stack.  */
989   YYSTYPE yyvsa[YYINITDEPTH];
990   YYSTYPE *yyvs = yyvsa;
991   YYSTYPE *yyvsp;
992
993
994
995 #define YYPOPSTACK   (yyvsp--, yyssp--)
996
997   YYSIZE_T yystacksize = YYINITDEPTH;
998
999   /* The variables used to return semantic value and location from the
1000      action routines.  */
1001   YYSTYPE yyval;
1002
1003
1004   /* When reducing, the number of symbols on the RHS of the reduced
1005      rule.  */
1006   int yylen;
1007
1008   YYDPRINTF ((stderr, "Starting parse\n"));
1009
1010   yystate = 0;
1011   yyerrstatus = 0;
1012   yynerrs = 0;
1013   yychar = YYEMPTY;             /* Cause a token to be read.  */
1014
1015   /* Initialize stack pointers.
1016      Waste one element of value and location stack
1017      so that they stay on the same level as the state stack.
1018      The wasted elements are never initialized.  */
1019
1020   yyssp = yyss;
1021   yyvsp = yyvs;
1022
1023   goto yysetstate;
1024
1025 /*------------------------------------------------------------.
1026 | yynewstate -- Push a new state, which is found in yystate.  |
1027 `------------------------------------------------------------*/
1028  yynewstate:
1029   /* In all cases, when you get here, the value and location stacks
1030      have just been pushed. so pushing a state here evens the stacks.
1031      */
1032   yyssp++;
1033
1034  yysetstate:
1035   *yyssp = yystate;
1036
1037   if (yyss + yystacksize - 1 <= yyssp)
1038     {
1039       /* Get the current used size of the three stacks, in elements.  */
1040       YYSIZE_T yysize = yyssp - yyss + 1;
1041
1042 #ifdef yyoverflow
1043       {
1044         /* Give user a chance to reallocate the stack. Use copies of
1045            these so that the &'s don't force the real ones into
1046            memory.  */
1047         YYSTYPE *yyvs1 = yyvs;
1048         short int *yyss1 = yyss;
1049
1050
1051         /* Each stack pointer address is followed by the size of the
1052            data in use in that stack, in bytes.  This used to be a
1053            conditional around just the two extra args, but that might
1054            be undefined if yyoverflow is a macro.  */
1055         yyoverflow (YY_("memory exhausted"),
1056                     &yyss1, yysize * sizeof (*yyssp),
1057                     &yyvs1, yysize * sizeof (*yyvsp),
1058
1059                     &yystacksize);
1060
1061         yyss = yyss1;
1062         yyvs = yyvs1;
1063       }
1064 #else /* no yyoverflow */
1065 # ifndef YYSTACK_RELOCATE
1066       goto yyexhaustedlab;
1067 # else
1068       /* Extend the stack our own way.  */
1069       if (YYMAXDEPTH <= yystacksize)
1070         goto yyexhaustedlab;
1071       yystacksize *= 2;
1072       if (YYMAXDEPTH < yystacksize)
1073         yystacksize = YYMAXDEPTH;
1074
1075       {
1076         short int *yyss1 = yyss;
1077         union yyalloc *yyptr =
1078           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1079         if (! yyptr)
1080           goto yyexhaustedlab;
1081         YYSTACK_RELOCATE (yyss);
1082         YYSTACK_RELOCATE (yyvs);
1083
1084 #  undef YYSTACK_RELOCATE
1085         if (yyss1 != yyssa)
1086           YYSTACK_FREE (yyss1);
1087       }
1088 # endif
1089 #endif /* no yyoverflow */
1090
1091       yyssp = yyss + yysize - 1;
1092       yyvsp = yyvs + yysize - 1;
1093
1094
1095       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1096                   (unsigned long int) yystacksize));
1097
1098       if (yyss + yystacksize - 1 <= yyssp)
1099         YYABORT;
1100     }
1101
1102   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1103
1104   goto yybackup;
1105
1106 /*-----------.
1107 | yybackup.  |
1108 `-----------*/
1109 yybackup:
1110
1111 /* Do appropriate processing given the current state.  */
1112 /* Read a look-ahead token if we need one and don't already have one.  */
1113 /* yyresume: */
1114
1115   /* First try to decide what to do without reference to look-ahead token.  */
1116
1117   yyn = yypact[yystate];
1118   if (yyn == YYPACT_NINF)
1119     goto yydefault;
1120
1121   /* Not known => get a look-ahead token if don't already have one.  */
1122
1123   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
1124   if (yychar == YYEMPTY)
1125     {
1126       YYDPRINTF ((stderr, "Reading a token: "));
1127       yychar = YYLEX;
1128     }
1129
1130   if (yychar <= YYEOF)
1131     {
1132       yychar = yytoken = YYEOF;
1133       YYDPRINTF ((stderr, "Now at end of input.\n"));
1134     }
1135   else
1136     {
1137       yytoken = YYTRANSLATE (yychar);
1138       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1139     }
1140
1141   /* If the proper action on seeing token YYTOKEN is to reduce or to
1142      detect an error, take that action.  */
1143   yyn += yytoken;
1144   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1145     goto yydefault;
1146   yyn = yytable[yyn];
1147   if (yyn <= 0)
1148     {
1149       if (yyn == 0 || yyn == YYTABLE_NINF)
1150         goto yyerrlab;
1151       yyn = -yyn;
1152       goto yyreduce;
1153     }
1154
1155   if (yyn == YYFINAL)
1156     YYACCEPT;
1157
1158   /* Shift the look-ahead token.  */
1159   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1160
1161   /* Discard the token being shifted unless it is eof.  */
1162   if (yychar != YYEOF)
1163     yychar = YYEMPTY;
1164
1165   *++yyvsp = yylval;
1166
1167
1168   /* Count tokens shifted since error; after three, turn off error
1169      status.  */
1170   if (yyerrstatus)
1171     yyerrstatus--;
1172
1173   yystate = yyn;
1174   goto yynewstate;
1175
1176
1177 /*-----------------------------------------------------------.
1178 | yydefault -- do the default action for the current state.  |
1179 `-----------------------------------------------------------*/
1180 yydefault:
1181   yyn = yydefact[yystate];
1182   if (yyn == 0)
1183     goto yyerrlab;
1184   goto yyreduce;
1185
1186
1187 /*-----------------------------.
1188 | yyreduce -- Do a reduction.  |
1189 `-----------------------------*/
1190 yyreduce:
1191   /* yyn is the number of a rule to reduce with.  */
1192   yylen = yyr2[yyn];
1193
1194   /* If YYLEN is nonzero, implement the default value of the action:
1195      `$$ = $1'.
1196
1197      Otherwise, the following line sets YYVAL to garbage.
1198      This behavior is undocumented and Bison
1199      users should not rely upon it.  Assigning to YYVAL
1200      unconditionally makes the parser a bit smaller, and it avoids a
1201      GCC warning that YYVAL may be used uninitialized.  */
1202   yyval = yyvsp[1-yylen];
1203
1204
1205   YY_REDUCE_PRINT (yyn);
1206   switch (yyn)
1207     {
1208         case 12:
1209 #line 75 "uparse.y"
1210     {
1211             char * errstr = vstralloc("Invalid command: ", yytext, NULL);
1212             yyerror(errstr);
1213             amfree(errstr);
1214             YYERROR;
1215         }
1216     break;
1217
1218   case 13:
1219 #line 84 "uparse.y"
1220     { list_host(); }
1221     break;
1222
1223   case 14:
1224 #line 85 "uparse.y"
1225     { list_disk((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1226     break;
1227
1228   case 15:
1229 #line 86 "uparse.y"
1230     { list_disk(NULL); }
1231     break;
1232
1233   case 16:
1234 #line 87 "uparse.y"
1235     { set_date((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1236     break;
1237
1238   case 17:
1239 #line 88 "uparse.y"
1240     { set_host((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1241     break;
1242
1243   case 18:
1244 #line 89 "uparse.y"
1245     { set_disk((yyvsp[-1].strval), (yyvsp[0].strval)); amfree((yyvsp[-1].strval)); amfree((yyvsp[0].strval)); }
1246     break;
1247
1248   case 19:
1249 #line 90 "uparse.y"
1250     { set_disk((yyvsp[0].strval), NULL); amfree((yyvsp[0].strval)); }
1251     break;
1252
1253   case 20:
1254 #line 91 "uparse.y"
1255     { set_tape((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1256     break;
1257
1258   case 21:
1259 #line 92 "uparse.y"
1260     { set_tape(""); }
1261     break;
1262
1263   case 22:
1264 #line 93 "uparse.y"
1265     { cd_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1266     break;
1267
1268   case 23:
1269 #line 94 "uparse.y"
1270     { cd_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1271     break;
1272
1273   case 24:
1274 #line 95 "uparse.y"
1275     {
1276 #ifdef SAMBA_CLIENT
1277                          set_mode(SAMBA_SMBCLIENT);
1278 #endif /* SAMBA_CLIENT */
1279                     }
1280     break;
1281
1282   case 25:
1283 #line 100 "uparse.y"
1284     {
1285 #ifdef SAMBA_CLIENT
1286                          set_mode(SAMBA_TAR);
1287 #endif /* SAMBA_CLIENT */
1288                     }
1289     break;
1290
1291   case 26:
1292 #line 108 "uparse.y"
1293     { list_disk_history(); }
1294     break;
1295
1296   case 27:
1297 #line 109 "uparse.y"
1298     { list_directory(); }
1299     break;
1300
1301   case 28:
1302 #line 110 "uparse.y"
1303     { display_extract_list((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1304     break;
1305
1306   case 29:
1307 #line 111 "uparse.y"
1308     { display_extract_list(NULL); }
1309     break;
1310
1311   case 30:
1312 #line 112 "uparse.y"
1313     { show_directory(); }
1314     break;
1315
1316   case 31:
1317 #line 113 "uparse.y"
1318     { clear_extract_list(); }
1319     break;
1320
1321   case 32:
1322 #line 114 "uparse.y"
1323     { show_mode (); }
1324     break;
1325
1326   case 33:
1327 #line 118 "uparse.y"
1328     { quit(); }
1329     break;
1330
1331   case 35:
1332 #line 126 "uparse.y"
1333     { add_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1334     break;
1335
1336   case 36:
1337 #line 127 "uparse.y"
1338     { add_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1339     break;
1340
1341   case 38:
1342 #line 135 "uparse.y"
1343     { add_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1344     break;
1345
1346   case 39:
1347 #line 136 "uparse.y"
1348     { add_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1349     break;
1350
1351   case 41:
1352 #line 144 "uparse.y"
1353     { delete_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1354     break;
1355
1356   case 42:
1357 #line 145 "uparse.y"
1358     { delete_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1359     break;
1360
1361   case 44:
1362 #line 153 "uparse.y"
1363     { delete_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1364     break;
1365
1366   case 45:
1367 #line 154 "uparse.y"
1368     { delete_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
1369     break;
1370
1371   case 46:
1372 #line 158 "uparse.y"
1373     { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); }
1374     break;
1375
1376   case 47:
1377 #line 159 "uparse.y"
1378     {
1379                 if (chdir((yyvsp[0].strval)) == -1) {
1380                         perror((yyvsp[0].strval));
1381                 }
1382                 amfree((yyvsp[0].strval));
1383         }
1384     break;
1385
1386   case 48:
1387 #line 168 "uparse.y"
1388     { help_list(); }
1389     break;
1390
1391   case 49:
1392 #line 172 "uparse.y"
1393     { extract_files(); }
1394     break;
1395
1396
1397       default: break;
1398     }
1399
1400 /* Line 1126 of yacc.c.  */
1401 #line 1402 "uparse.c"
1402 \f
1403   yyvsp -= yylen;
1404   yyssp -= yylen;
1405
1406
1407   YY_STACK_PRINT (yyss, yyssp);
1408
1409   *++yyvsp = yyval;
1410
1411
1412   /* Now `shift' the result of the reduction.  Determine what state
1413      that goes to, based on the state we popped back to and the rule
1414      number reduced by.  */
1415
1416   yyn = yyr1[yyn];
1417
1418   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1419   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1420     yystate = yytable[yystate];
1421   else
1422     yystate = yydefgoto[yyn - YYNTOKENS];
1423
1424   goto yynewstate;
1425
1426
1427 /*------------------------------------.
1428 | yyerrlab -- here on detecting error |
1429 `------------------------------------*/
1430 yyerrlab:
1431   /* If not already recovering from an error, report this error.  */
1432   if (!yyerrstatus)
1433     {
1434       ++yynerrs;
1435 #if YYERROR_VERBOSE
1436       yyn = yypact[yystate];
1437
1438       if (YYPACT_NINF < yyn && yyn < YYLAST)
1439         {
1440           int yytype = YYTRANSLATE (yychar);
1441           YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1442           YYSIZE_T yysize = yysize0;
1443           YYSIZE_T yysize1;
1444           int yysize_overflow = 0;
1445           char *yymsg = 0;
1446 #         define YYERROR_VERBOSE_ARGS_MAXIMUM 5
1447           char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1448           int yyx;
1449
1450 #if 0
1451           /* This is so xgettext sees the translatable formats that are
1452              constructed on the fly.  */
1453           YY_("syntax error, unexpected %s");
1454           YY_("syntax error, unexpected %s, expecting %s");
1455           YY_("syntax error, unexpected %s, expecting %s or %s");
1456           YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1457           YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1458 #endif
1459           char *yyfmt;
1460           char const *yyf;
1461           static char const yyunexpected[] = "syntax error, unexpected %s";
1462           static char const yyexpecting[] = ", expecting %s";
1463           static char const yyor[] = " or %s";
1464           char yyformat[sizeof yyunexpected
1465                         + sizeof yyexpecting - 1
1466                         + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1467                            * (sizeof yyor - 1))];
1468           char const *yyprefix = yyexpecting;
1469
1470           /* Start YYX at -YYN if negative to avoid negative indexes in
1471              YYCHECK.  */
1472           int yyxbegin = yyn < 0 ? -yyn : 0;
1473
1474           /* Stay within bounds of both yycheck and yytname.  */
1475           int yychecklim = YYLAST - yyn;
1476           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1477           int yycount = 1;
1478
1479           yyarg[0] = yytname[yytype];
1480           yyfmt = yystpcpy (yyformat, yyunexpected);
1481
1482           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1483             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1484               {
1485                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1486                   {
1487                     yycount = 1;
1488                     yysize = yysize0;
1489                     yyformat[sizeof yyunexpected - 1] = '\0';
1490                     break;
1491                   }
1492                 yyarg[yycount++] = yytname[yyx];
1493                 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1494                 yysize_overflow |= yysize1 < yysize;
1495                 yysize = yysize1;
1496                 yyfmt = yystpcpy (yyfmt, yyprefix);
1497                 yyprefix = yyor;
1498               }
1499
1500           yyf = YY_(yyformat);
1501           yysize1 = yysize + yystrlen (yyf);
1502           yysize_overflow |= yysize1 < yysize;
1503           yysize = yysize1;
1504
1505           if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
1506             yymsg = (char *) YYSTACK_ALLOC (yysize);
1507           if (yymsg)
1508             {
1509               /* Avoid sprintf, as that infringes on the user's name space.
1510                  Don't have undefined behavior even if the translation
1511                  produced a string with the wrong number of "%s"s.  */
1512               char *yyp = yymsg;
1513               int yyi = 0;
1514               while ((*yyp = *yyf))
1515                 {
1516                   if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1517                     {
1518                       yyp += yytnamerr (yyp, yyarg[yyi++]);
1519                       yyf += 2;
1520                     }
1521                   else
1522                     {
1523                       yyp++;
1524                       yyf++;
1525                     }
1526                 }
1527               yyerror (yymsg);
1528               YYSTACK_FREE (yymsg);
1529             }
1530           else
1531             {
1532               yyerror (YY_("syntax error"));
1533               goto yyexhaustedlab;
1534             }
1535         }
1536       else
1537 #endif /* YYERROR_VERBOSE */
1538         yyerror (YY_("syntax error"));
1539     }
1540
1541
1542
1543   if (yyerrstatus == 3)
1544     {
1545       /* If just tried and failed to reuse look-ahead token after an
1546          error, discard it.  */
1547
1548       if (yychar <= YYEOF)
1549         {
1550           /* Return failure if at end of input.  */
1551           if (yychar == YYEOF)
1552             YYABORT;
1553         }
1554       else
1555         {
1556           yydestruct ("Error: discarding", yytoken, &yylval);
1557           yychar = YYEMPTY;
1558         }
1559     }
1560
1561   /* Else will try to reuse look-ahead token after shifting the error
1562      token.  */
1563   goto yyerrlab1;
1564
1565
1566 /*---------------------------------------------------.
1567 | yyerrorlab -- error raised explicitly by YYERROR.  |
1568 `---------------------------------------------------*/
1569 yyerrorlab:
1570
1571   /* Pacify compilers like GCC when the user code never invokes
1572      YYERROR and the label yyerrorlab therefore never appears in user
1573      code.  */
1574   if (0)
1575      goto yyerrorlab;
1576
1577 yyvsp -= yylen;
1578   yyssp -= yylen;
1579   yystate = *yyssp;
1580   goto yyerrlab1;
1581
1582
1583 /*-------------------------------------------------------------.
1584 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
1585 `-------------------------------------------------------------*/
1586 yyerrlab1:
1587   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1588
1589   for (;;)
1590     {
1591       yyn = yypact[yystate];
1592       if (yyn != YYPACT_NINF)
1593         {
1594           yyn += YYTERROR;
1595           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1596             {
1597               yyn = yytable[yyn];
1598               if (0 < yyn)
1599                 break;
1600             }
1601         }
1602
1603       /* Pop the current state because it cannot handle the error token.  */
1604       if (yyssp == yyss)
1605         YYABORT;
1606
1607
1608       yydestruct ("Error: popping", yystos[yystate], yyvsp);
1609       YYPOPSTACK;
1610       yystate = *yyssp;
1611       YY_STACK_PRINT (yyss, yyssp);
1612     }
1613
1614   if (yyn == YYFINAL)
1615     YYACCEPT;
1616
1617   *++yyvsp = yylval;
1618
1619
1620   /* Shift the error token. */
1621   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1622
1623   yystate = yyn;
1624   goto yynewstate;
1625
1626
1627 /*-------------------------------------.
1628 | yyacceptlab -- YYACCEPT comes here.  |
1629 `-------------------------------------*/
1630 yyacceptlab:
1631   yyresult = 0;
1632   goto yyreturn;
1633
1634 /*-----------------------------------.
1635 | yyabortlab -- YYABORT comes here.  |
1636 `-----------------------------------*/
1637 yyabortlab:
1638   yyresult = 1;
1639   goto yyreturn;
1640
1641 #ifndef yyoverflow
1642 /*-------------------------------------------------.
1643 | yyexhaustedlab -- memory exhaustion comes here.  |
1644 `-------------------------------------------------*/
1645 yyexhaustedlab:
1646   yyerror (YY_("memory exhausted"));
1647   yyresult = 2;
1648   /* Fall through.  */
1649 #endif
1650
1651 yyreturn:
1652   if (yychar != YYEOF && yychar != YYEMPTY)
1653      yydestruct ("Cleanup: discarding lookahead",
1654                  yytoken, &yylval);
1655   while (yyssp != yyss)
1656     {
1657       yydestruct ("Cleanup: popping",
1658                   yystos[*yyssp], yyvsp);
1659       YYPOPSTACK;
1660     }
1661 #ifndef yyoverflow
1662   if (yyss != yyssa)
1663     YYSTACK_FREE (yyss);
1664 #endif
1665   return yyresult;
1666 }
1667
1668
1669 #line 176 "uparse.y"
1670
1671
1672 void
1673 yyerror(
1674     char *      s)
1675 {
1676         printf("%s\n", s);
1677 }
1678