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