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