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