]> Creatis software - clitk.git/blob - utilities/gengetopt/parser.cc
Debug RTStruct conversion with empty struc
[clitk.git] / utilities / gengetopt / parser.cc
1
2 /* A Bison parser, made by GNU Bison 2.4.1.  */
3
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
5    
6       Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7    Free Software Foundation, Inc.
8    
9    This program is free software: you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation, either version 3 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
21
22 /* As a special exception, you may create a larger work that contains
23    part or all of the Bison parser skeleton and distribute that work
24    under terms of your choice, so long as that work isn't itself a
25    parser generator using the skeleton or a modified version thereof
26    as a parser skeleton.  Alternatively, if you modify or redistribute
27    the parser skeleton itself, you may (at your option) remove this
28    special exception, which will cause the skeleton and the resulting
29    Bison output files to be licensed under the GNU General Public
30    License without this special exception.
31    
32    This special exception was added by the Free Software Foundation in
33    version 2.2 of Bison.  */
34
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36    simplifying the original so-called "semantic" parser.  */
37
38 /* All symbols defined below should begin with yy or YY, to avoid
39    infringing on user name space.  This should be done even for local
40    variables, as they might otherwise be expanded by user macros.
41    There are some unavoidable exceptions within include files to
42    define necessary library symbols; they are noted "INFRINGES ON
43    USER NAME SPACE" below.  */
44
45 /* Identify Bison output.  */
46 #define YYBISON 1
47
48 /* Bison version.  */
49 #define YYBISON_VERSION "2.4.1"
50
51 /* Skeleton name.  */
52 #define YYSKELETON_NAME "yacc.c"
53
54 /* Pure parsers.  */
55 #define YYPURE 0
56
57 /* Push parsers.  */
58 #define YYPUSH 0
59
60 /* Pull parsers.  */
61 #define YYPULL 1
62
63 /* Using locations.  */
64 #define YYLSP_NEEDED 1
65
66
67
68 /* Copy the first part of user declarations.  */
69
70 /* Line 189 of yacc.c  */
71 #line 22 "../../src/parser.yy"
72
73
74 #ifdef HAVE_CONFIG_H
75 #include "config.h"
76 #endif
77
78 #include <stdlib.h>
79 #include <string.h>
80 #include <stdio.h>
81 #include <string>
82
83 #include "my_sstream.h"
84
85 #include "acceptedvalues.h"
86
87 #include "argsdef.h"
88
89 #include "gengetopt.h"
90 #include "errorcodes.h"
91 #include "ggos.h"
92 #include "yyerror.h"
93
94 extern int gengetopt_count_line;
95 extern char * gengetopt_input_filename;
96
97 static int gengetopt_package_given = 0;
98 static int gengetopt_version_given = 0;
99 static int gengetopt_purpose_given = 0;
100 static int gengetopt_usage_given = 0;
101 static int gengetopt_description_given = 0;
102
103 /// the last option parsed
104 static gengetopt_option *current_option = 0;
105
106 extern int yylex (void) ;
107
108 //#define YYERROR_VERBOSE 1
109
110 void check_result(int o, gengetopt_option *opt)
111 {
112   if (o)
113     {
114         ostringstream err;
115
116     switch (o)
117     {
118     case NOT_ENOUGH_MEMORY:
119         yyerror (opt, "not enough memory");
120         break;
121     case REQ_LONG_OPTION:
122         err << "long option redefined \'" << opt->long_opt << "\'";
123         yyerror (opt, err.str().c_str());
124                 break;
125     case REQ_SHORT_OPTION:
126         err << "short option redefined \'" << opt->short_opt << "\'";
127         yyerror (opt, err.str().c_str());
128         break;
129     case FOUND_BUG:
130         yyerror (opt, "bug found!!");
131         break;
132     case GROUP_UNDEFINED:
133         yyerror (opt, "group undefined");
134         break;
135     case MODE_UNDEFINED:
136         yyerror (opt, "mode undefined");
137         break;
138     case INVALID_DEFAULT_VALUE:
139         yyerror (opt, "invalid default value");
140         break;
141     case NOT_REQUESTED_TYPE:
142         yyerror (opt, "type specification not requested");
143         break;
144     case NOT_VALID_SPECIFICATION:
145       yyerror (opt, "invalid specification for this kind of option");
146       break;
147     case SPECIFY_FLAG_STAT:
148       yyerror (opt, "you must specify the default flag status");
149       break;
150     case NOT_GROUP_OPTION:
151       yyerror (opt, "group specification for a non group option");
152       break;
153     case NOT_MODE_OPTION:
154       yyerror (opt, "mode specification for an option not belonging to a mode");
155       break;
156     case SPECIFY_GROUP:
157       yyerror (opt, "missing group specification");
158       break;
159     case SPECIFY_MODE:
160       yyerror (opt, "missing mode specification");
161       break;
162     case INVALID_NUMERIC_VALUE:
163         yyerror (opt, "invalid numeric value");
164         break;
165     case INVALID_ENUM_TYPE_USE:
166         yyerror (opt, "enum type can only be specified for options with values");
167         break;
168     case HELP_REDEFINED:
169         yyerror (opt, "if you want to redefine --help, please use option --no-help");
170         break;
171     case VERSION_REDEFINED:
172         yyerror (opt, "if you want to redefine --version, please use option --no-version");
173         break;
174     }
175   }
176 }
177
178 /* the number of allowed occurrences of a multiple option */
179 struct multiple_size
180 {
181     /* these strings are allocated dynamically and NOT
182       automatically freed upon destruction */
183     char *min;
184     char *max;
185
186     /* if no limit is specified then initialized to 0.
187        if the same size is specified for min and max, it means that an exact
188        number of occurrences is required*/
189     multiple_size(const char *m = "0", const char *M = "0") :
190         min(strdup(m)), max(strdup(M))
191     {}
192 };
193
194 #define check_error if (o) YYERROR;
195
196
197
198 /* Line 189 of yacc.c  */
199 #line 200 "../../src/parser.cc"
200
201 /* Enabling traces.  */
202 #ifndef YYDEBUG
203 # define YYDEBUG 0
204 #endif
205
206 /* Enabling verbose error messages.  */
207 #ifdef YYERROR_VERBOSE
208 # undef YYERROR_VERBOSE
209 # define YYERROR_VERBOSE 1
210 #else
211 # define YYERROR_VERBOSE 0
212 #endif
213
214 /* Enabling the token table.  */
215 #ifndef YYTOKEN_TABLE
216 # define YYTOKEN_TABLE 0
217 #endif
218
219
220 /* Tokens.  */
221 #ifndef YYTOKENTYPE
222 # define YYTOKENTYPE
223    /* Put the tokens into the symbol table, so that GDB and other debuggers
224       know about them.  */
225    enum yytokentype {
226      TOK_PACKAGE = 258,
227      TOK_VERSION = 259,
228      TOK_OPTION = 260,
229      TOK_DEFGROUP = 261,
230      TOK_GROUPOPTION = 262,
231      TOK_DEFMODE = 263,
232      TOK_MODEOPTION = 264,
233      TOK_YES = 265,
234      TOK_NO = 266,
235      TOK_ON = 267,
236      TOK_OFF = 268,
237      TOK_FLAG = 269,
238      TOK_PURPOSE = 270,
239      TOK_DESCRIPTION = 271,
240      TOK_USAGE = 272,
241      TOK_DEFAULT = 273,
242      TOK_GROUP = 274,
243      TOK_GROUPDESC = 275,
244      TOK_MODE = 276,
245      TOK_MODEDESC = 277,
246      TOK_MULTIPLE = 278,
247      TOK_ARGOPTIONAL = 279,
248      TOK_TYPESTR = 280,
249      TOK_SECTION = 281,
250      TOK_DETAILS = 282,
251      TOK_SECTIONDESC = 283,
252      TOK_TEXT = 284,
253      TOK_ARGS = 285,
254      TOK_VALUES = 286,
255      TOK_HIDDEN = 287,
256      TOK_DEPENDON = 288,
257      TOK_STRING = 289,
258      TOK_CHAR = 290,
259      TOK_ARGTYPE = 291,
260      TOK_SIZE = 292
261    };
262 #endif
263 /* Tokens.  */
264 #define TOK_PACKAGE 258
265 #define TOK_VERSION 259
266 #define TOK_OPTION 260
267 #define TOK_DEFGROUP 261
268 #define TOK_GROUPOPTION 262
269 #define TOK_DEFMODE 263
270 #define TOK_MODEOPTION 264
271 #define TOK_YES 265
272 #define TOK_NO 266
273 #define TOK_ON 267
274 #define TOK_OFF 268
275 #define TOK_FLAG 269
276 #define TOK_PURPOSE 270
277 #define TOK_DESCRIPTION 271
278 #define TOK_USAGE 272
279 #define TOK_DEFAULT 273
280 #define TOK_GROUP 274
281 #define TOK_GROUPDESC 275
282 #define TOK_MODE 276
283 #define TOK_MODEDESC 277
284 #define TOK_MULTIPLE 278
285 #define TOK_ARGOPTIONAL 279
286 #define TOK_TYPESTR 280
287 #define TOK_SECTION 281
288 #define TOK_DETAILS 282
289 #define TOK_SECTIONDESC 283
290 #define TOK_TEXT 284
291 #define TOK_ARGS 285
292 #define TOK_VALUES 286
293 #define TOK_HIDDEN 287
294 #define TOK_DEPENDON 288
295 #define TOK_STRING 289
296 #define TOK_CHAR 290
297 #define TOK_ARGTYPE 291
298 #define TOK_SIZE 292
299
300
301
302
303 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
304 typedef union YYSTYPE
305 {
306
307 /* Line 214 of yacc.c  */
308 #line 148 "../../src/parser.yy"
309
310     char   *str;
311     char    chr;
312     int     argtype;
313     int     boolean;
314     class AcceptedValues *ValueList;
315     struct gengetopt_option *gengetopt_option;
316     struct multiple_size *multiple_size;
317
318
319
320 /* Line 214 of yacc.c  */
321 #line 322 "../../src/parser.cc"
322 } YYSTYPE;
323 # define YYSTYPE_IS_TRIVIAL 1
324 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
325 # define YYSTYPE_IS_DECLARED 1
326 #endif
327
328 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
329 typedef struct YYLTYPE
330 {
331   int first_line;
332   int first_column;
333   int last_line;
334   int last_column;
335 } YYLTYPE;
336 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
337 # define YYLTYPE_IS_DECLARED 1
338 # define YYLTYPE_IS_TRIVIAL 1
339 #endif
340
341
342 /* Copy the second part of user declarations.  */
343
344
345 /* Line 264 of yacc.c  */
346 #line 347 "../../src/parser.cc"
347
348 #ifdef short
349 # undef short
350 #endif
351
352 #ifdef YYTYPE_UINT8
353 typedef YYTYPE_UINT8 yytype_uint8;
354 #else
355 typedef unsigned char yytype_uint8;
356 #endif
357
358 #ifdef YYTYPE_INT8
359 typedef YYTYPE_INT8 yytype_int8;
360 #elif (defined __STDC__ || defined __C99__FUNC__ \
361      || defined __cplusplus || defined _MSC_VER)
362 typedef signed char yytype_int8;
363 #else
364 typedef short int yytype_int8;
365 #endif
366
367 #ifdef YYTYPE_UINT16
368 typedef YYTYPE_UINT16 yytype_uint16;
369 #else
370 typedef unsigned short int yytype_uint16;
371 #endif
372
373 #ifdef YYTYPE_INT16
374 typedef YYTYPE_INT16 yytype_int16;
375 #else
376 typedef short int yytype_int16;
377 #endif
378
379 #ifndef YYSIZE_T
380 # ifdef __SIZE_TYPE__
381 #  define YYSIZE_T __SIZE_TYPE__
382 # elif defined size_t
383 #  define YYSIZE_T size_t
384 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
385      || defined __cplusplus || defined _MSC_VER)
386 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
387 #  define YYSIZE_T size_t
388 # else
389 #  define YYSIZE_T unsigned int
390 # endif
391 #endif
392
393 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
394
395 #ifndef YY_
396 # if YYENABLE_NLS
397 #  if ENABLE_NLS
398 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
399 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
400 #  endif
401 # endif
402 # ifndef YY_
403 #  define YY_(msgid) msgid
404 # endif
405 #endif
406
407 /* Suppress unused-variable warnings by "using" E.  */
408 #if ! defined lint || defined __GNUC__
409 # define YYUSE(e) ((void) (e))
410 #else
411 # define YYUSE(e) /* empty */
412 #endif
413
414 /* Identity function, used to suppress warnings about constant conditions.  */
415 #ifndef lint
416 # define YYID(n) (n)
417 #else
418 #if (defined __STDC__ || defined __C99__FUNC__ \
419      || defined __cplusplus || defined _MSC_VER)
420 static int
421 YYID (int yyi)
422 #else
423 static int
424 YYID (yyi)
425     int yyi;
426 #endif
427 {
428   return yyi;
429 }
430 #endif
431
432 #if ! defined yyoverflow || YYERROR_VERBOSE
433
434 /* The parser invokes alloca or malloc; define the necessary symbols.  */
435
436 # ifdef YYSTACK_USE_ALLOCA
437 #  if YYSTACK_USE_ALLOCA
438 #   ifdef __GNUC__
439 #    define YYSTACK_ALLOC __builtin_alloca
440 #   elif defined __BUILTIN_VA_ARG_INCR
441 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
442 #   elif defined _AIX
443 #    define YYSTACK_ALLOC __alloca
444 #   elif defined _MSC_VER
445 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
446 #    define alloca _alloca
447 #   else
448 #    define YYSTACK_ALLOC alloca
449 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
450      || defined __cplusplus || defined _MSC_VER)
451 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
452 #     ifndef _STDLIB_H
453 #      define _STDLIB_H 1
454 #     endif
455 #    endif
456 #   endif
457 #  endif
458 # endif
459
460 # ifdef YYSTACK_ALLOC
461    /* Pacify GCC's `empty if-body' warning.  */
462 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
463 #  ifndef YYSTACK_ALLOC_MAXIMUM
464     /* The OS might guarantee only one guard page at the bottom of the stack,
465        and a page size can be as small as 4096 bytes.  So we cannot safely
466        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
467        to allow for a few compiler-allocated temporary stack slots.  */
468 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
469 #  endif
470 # else
471 #  define YYSTACK_ALLOC YYMALLOC
472 #  define YYSTACK_FREE YYFREE
473 #  ifndef YYSTACK_ALLOC_MAXIMUM
474 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
475 #  endif
476 #  if (defined __cplusplus && ! defined _STDLIB_H \
477        && ! ((defined YYMALLOC || defined malloc) \
478              && (defined YYFREE || defined free)))
479 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
480 #   ifndef _STDLIB_H
481 #    define _STDLIB_H 1
482 #   endif
483 #  endif
484 #  ifndef YYMALLOC
485 #   define YYMALLOC malloc
486 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
487      || defined __cplusplus || defined _MSC_VER)
488 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
489 #   endif
490 #  endif
491 #  ifndef YYFREE
492 #   define YYFREE free
493 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
494      || defined __cplusplus || defined _MSC_VER)
495 void free (void *); /* INFRINGES ON USER NAME SPACE */
496 #   endif
497 #  endif
498 # endif
499 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
500
501
502 #if (! defined yyoverflow \
503      && (! defined __cplusplus \
504          || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
505              && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
506
507 /* A type that is properly aligned for any stack member.  */
508 union yyalloc
509 {
510   yytype_int16 yyss_alloc;
511   YYSTYPE yyvs_alloc;
512   YYLTYPE yyls_alloc;
513 };
514
515 /* The size of the maximum gap between one aligned stack and the next.  */
516 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
517
518 /* The size of an array large to enough to hold all stacks, each with
519    N elements.  */
520 # define YYSTACK_BYTES(N) \
521      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
522       + 2 * YYSTACK_GAP_MAXIMUM)
523
524 /* Copy COUNT objects from FROM to TO.  The source and destination do
525    not overlap.  */
526 # ifndef YYCOPY
527 #  if defined __GNUC__ && 1 < __GNUC__
528 #   define YYCOPY(To, From, Count) \
529       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
530 #  else
531 #   define YYCOPY(To, From, Count)              \
532       do                                        \
533         {                                       \
534           YYSIZE_T yyi;                         \
535           for (yyi = 0; yyi < (Count); yyi++)   \
536             (To)[yyi] = (From)[yyi];            \
537         }                                       \
538       while (YYID (0))
539 #  endif
540 # endif
541
542 /* Relocate STACK from its old location to the new one.  The
543    local variables YYSIZE and YYSTACKSIZE give the old and new number of
544    elements in the stack, and YYPTR gives the new location of the
545    stack.  Advance YYPTR to a properly aligned location for the next
546    stack.  */
547 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
548     do                                                                  \
549       {                                                                 \
550         YYSIZE_T yynewbytes;                                            \
551         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
552         Stack = &yyptr->Stack_alloc;                                    \
553         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
554         yyptr += yynewbytes / sizeof (*yyptr);                          \
555       }                                                                 \
556     while (YYID (0))
557
558 #endif
559
560 /* YYFINAL -- State number of the termination state.  */
561 #define YYFINAL  43
562 /* YYLAST -- Last index in YYTABLE.  */
563 #define YYLAST   92
564
565 /* YYNTOKENS -- Number of terminals.  */
566 #define YYNTOKENS  43
567 /* YYNNTS -- Number of nonterminals.  */
568 #define YYNNTS  27
569 /* YYNRULES -- Number of rules.  */
570 #define YYNRULES  66
571 /* YYNRULES -- Number of states.  */
572 #define YYNSTATES  116
573
574 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
575 #define YYUNDEFTOK  2
576 #define YYMAXUTOK   292
577
578 #define YYTRANSLATE(YYX)                                                \
579   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
580
581 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
582 static const yytype_uint8 yytranslate[] =
583 {
584        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
585        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
586        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
587        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
588       40,    41,     2,     2,    39,    42,     2,     2,     2,     2,
589        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
590        2,    38,     2,     2,     2,     2,     2,     2,     2,     2,
591        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
592        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
593        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
594        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
595        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
596        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
597        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
598        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
599        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
600        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
601        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
602        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
603        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
604        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
605        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
606        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
607        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
608        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
609        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
610        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
611       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
612       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
613       35,    36,    37
614 };
615
616 #if YYDEBUG
617 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
618    YYRHS.  */
619 static const yytype_uint8 yyprhs[] =
620 {
621        0,     0,     3,     4,     7,     9,    11,    13,    15,    17,
622       19,    21,    23,    25,    27,    29,    31,    33,    36,    39,
623       42,    45,    48,    52,    55,    58,    63,    67,    73,    79,
624       85,    87,    90,    93,    98,   103,   108,   113,   118,   123,
625      128,   131,   135,   138,   141,   144,   145,   147,   149,   150,
626      152,   154,   156,   158,   159,   163,   164,   168,   169,   173,
627      175,   179,   181,   182,   186,   191,   196
628 };
629
630 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
631 static const yytype_int8 yyrhs[] =
632 {
633       44,     0,    -1,    -1,    45,    44,    -1,    46,    -1,    47,
634       -1,    53,    -1,    48,    -1,    49,    -1,    50,    -1,    51,
635       -1,    56,    -1,    52,    -1,    57,    -1,    54,    -1,    58,
636       -1,    55,    -1,     3,    34,    -1,     4,    34,    -1,    15,
637       59,    -1,    16,    59,    -1,    17,    59,    -1,    26,    59,
638       66,    -1,    29,    59,    -1,    30,    34,    -1,     6,    34,
639       64,    62,    -1,     8,    34,    65,    -1,     5,    34,    35,
640       59,    60,    -1,     7,    34,    35,    59,    60,    -1,     9,
641       34,    35,    59,    60,    -1,    34,    -1,    60,    63,    -1,
642       60,    36,    -1,    60,    25,    38,    34,    -1,    60,    27,
643       38,    59,    -1,    60,    31,    38,    67,    -1,    60,    18,
644       38,    34,    -1,    60,    19,    38,    34,    -1,    60,    21,
645       38,    34,    -1,    60,    33,    38,    34,    -1,    60,    24,
646       -1,    60,    23,    69,    -1,    60,    14,    -1,    60,    32,
647       -1,    60,    61,    -1,    -1,    12,    -1,    13,    -1,    -1,
648       10,    -1,    11,    -1,    10,    -1,    11,    -1,    -1,    20,
649       38,    34,    -1,    -1,    22,    38,    34,    -1,    -1,    28,
650       38,    34,    -1,    68,    -1,    67,    39,    68,    -1,    34,
651       -1,    -1,    40,    37,    41,    -1,    40,    37,    42,    41,
652       -1,    40,    42,    37,    41,    -1,    40,    37,    42,    37,
653       41,    -1
654 };
655
656 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
657 static const yytype_uint16 yyrline[] =
658 {
659        0,   209,   209,   211,   216,   217,   218,   219,   220,   221,
660      222,   223,   224,   225,   226,   227,   228,   233,   253,   273,
661      293,   313,   334,   341,   358,   365,   376,   387,   407,   426,
662      448,   451,   457,   462,   467,   472,   477,   482,   487,   492,
663      497,   502,   510,   515,   520,   525,   529,   530,   534,   535,
664      536,   540,   541,   545,   546,   550,   551,   555,   556,   560,
665      561,   565,   569,   570,   571,   572,   573
666 };
667 #endif
668
669 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
670 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
671    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
672 static const char *const yytname[] =
673 {
674   "$end", "error", "$undefined", "\"package\"", "\"version\"",
675   "\"option\"", "\"defgroup\"", "\"groupoption\"", "\"defmode\"",
676   "\"modeoption\"", "\"yes\"", "\"no\"", "\"on\"", "\"off\"", "\"flag\"",
677   "\"purpose\"", "\"description\"", "\"usage\"", "\"default\"",
678   "\"group\"", "\"groupdesc\"", "\"mode\"", "\"modedesc\"", "\"multiple\"",
679   "\"argoptional\"", "\"typestr\"", "\"section\"", "\"details\"",
680   "\"sectiondesc\"", "\"text\"", "\"args\"", "\"values\"", "\"hidden\"",
681   "\"dependon\"", "TOK_STRING", "TOK_CHAR", "TOK_ARGTYPE", "TOK_SIZE",
682   "'='", "','", "'('", "')'", "'-'", "$accept", "input", "statement",
683   "package", "version", "purpose", "description", "usage", "sectiondef",
684   "text", "args", "groupdef", "modedef", "option", "groupoption",
685   "modeoption", "quoted_string", "option_parts", "req_onoff",
686   "optional_yesno", "opt_yesno", "opt_groupdesc", "opt_modedesc",
687   "opt_sectiondesc", "listofvalues", "acceptedvalue", "multiple_size", 0
688 };
689 #endif
690
691 # ifdef YYPRINT
692 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
693    token YYLEX-NUM.  */
694 static const yytype_uint16 yytoknum[] =
695 {
696        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
697      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
698      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
699      285,   286,   287,   288,   289,   290,   291,   292,    61,    44,
700       40,    41,    45
701 };
702 # endif
703
704 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
705 static const yytype_uint8 yyr1[] =
706 {
707        0,    43,    44,    44,    45,    45,    45,    45,    45,    45,
708       45,    45,    45,    45,    45,    45,    45,    46,    47,    48,
709       49,    50,    51,    52,    53,    54,    55,    56,    57,    58,
710       59,    60,    60,    60,    60,    60,    60,    60,    60,    60,
711       60,    60,    60,    60,    60,    60,    61,    61,    62,    62,
712       62,    63,    63,    64,    64,    65,    65,    66,    66,    67,
713       67,    68,    69,    69,    69,    69,    69
714 };
715
716 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
717 static const yytype_uint8 yyr2[] =
718 {
719        0,     2,     0,     2,     1,     1,     1,     1,     1,     1,
720        1,     1,     1,     1,     1,     1,     1,     2,     2,     2,
721        2,     2,     3,     2,     2,     4,     3,     5,     5,     5,
722        1,     2,     2,     4,     4,     4,     4,     4,     4,     4,
723        2,     3,     2,     2,     2,     0,     1,     1,     0,     1,
724        1,     1,     1,     0,     3,     0,     3,     0,     3,     1,
725        3,     1,     0,     3,     4,     4,     5
726 };
727
728 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
729    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
730    means the default is an error.  */
731 static const yytype_uint8 yydefact[] =
732 {
733        2,     0,     0,     0,     0,     0,     0,     0,     0,     0,
734        0,     0,     0,     0,     0,     2,     4,     5,     7,     8,
735        9,    10,    12,     6,    14,    16,    11,    13,    15,    17,
736       18,     0,    53,     0,    55,     0,    30,    19,    20,    21,
737       57,    23,    24,     1,     3,     0,     0,    48,     0,     0,
738       26,     0,     0,    22,    45,     0,    49,    50,    25,    45,
739        0,    45,     0,    27,    54,    28,    56,    29,    58,    51,
740       52,    46,    47,    42,     0,     0,     0,    62,    40,     0,
741        0,     0,    43,     0,    32,    44,    31,     0,     0,     0,
742        0,    41,     0,     0,     0,     0,    36,    37,    38,     0,
743        0,    33,    34,    61,    35,    59,    39,    63,     0,     0,
744        0,     0,    64,    65,    60,    66
745 };
746
747 /* YYDEFGOTO[NTERM-NUM].  */
748 static const yytype_int8 yydefgoto[] =
749 {
750       -1,    14,    15,    16,    17,    18,    19,    20,    21,    22,
751       23,    24,    25,    26,    27,    28,    37,    63,    85,    58,
752       86,    47,    50,    53,   104,   105,    91
753 };
754
755 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
756    STATE-NUM.  */
757 #define YYPACT_NINF -40
758 static const yytype_int8 yypact[] =
759 {
760        1,   -13,    -8,    -6,    -5,    -2,    -1,     0,     3,     3,
761        3,     3,     3,     4,    25,     1,   -40,   -40,   -40,   -40,
762      -40,   -40,   -40,   -40,   -40,   -40,   -40,   -40,   -40,   -40,
763      -40,     5,    15,     6,    26,    14,   -40,   -40,   -40,   -40,
764       22,   -40,   -40,   -40,   -40,     3,    17,     2,     3,    21,
765      -40,     3,    23,   -40,   -40,    19,   -40,   -40,   -40,   -40,
766       28,   -40,    29,    33,   -40,    33,   -40,    33,   -40,   -40,
767      -40,   -40,   -40,   -40,    30,    32,    34,    27,   -40,    35,
768       36,    37,   -40,    38,   -40,   -40,   -40,    43,    44,    45,
769      -23,   -40,    46,     3,    47,    48,   -40,   -40,   -40,   -18,
770       49,   -40,   -40,   -40,    50,   -40,   -40,   -40,   -26,    42,
771       47,    51,   -40,   -40,   -40,   -40
772 };
773
774 /* YYPGOTO[NTERM-NUM].  */
775 static const yytype_int8 yypgoto[] =
776 {
777      -40,    56,   -40,   -40,   -40,   -40,   -40,   -40,   -40,   -40,
778      -40,   -40,   -40,   -40,   -40,   -40,    -9,   -39,   -40,   -40,
779      -40,   -40,   -40,   -40,   -40,   -25,   -40
780 };
781
782 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
783    positive, shift that token.  If negative, reduce the rule which
784    number is the opposite.  If zero, do what YYDEFACT says.
785    If YYTABLE_NINF, syntax error.  */
786 #define YYTABLE_NINF -1
787 static const yytype_uint8 yytable[] =
788 {
789       38,    39,    40,    41,     1,     2,     3,     4,     5,     6,
790        7,   111,    56,    57,    99,   112,     8,     9,    10,   100,
791       65,    29,    67,   107,   108,    43,    30,    11,    31,    32,
792       12,    13,    33,    34,    35,    46,    54,    36,    42,    59,
793       45,    48,    61,    69,    70,    71,    72,    73,    49,    51,
794       52,    74,    75,    64,    76,    55,    77,    78,    79,    60,
795       80,    62,    66,    68,    81,    82,    83,    90,    87,    84,
796       88,    44,    89,    92,    93,    94,    95,    96,    97,    98,
797      101,   103,   106,   113,   102,   114,   109,     0,     0,   110,
798        0,     0,   115
799 };
800
801 static const yytype_int8 yycheck[] =
802 {
803        9,    10,    11,    12,     3,     4,     5,     6,     7,     8,
804        9,    37,    10,    11,    37,    41,    15,    16,    17,    42,
805       59,    34,    61,    41,    42,     0,    34,    26,    34,    34,
806       29,    30,    34,    34,    34,    20,    45,    34,    34,    48,
807       35,    35,    51,    10,    11,    12,    13,    14,    22,    35,
808       28,    18,    19,    34,    21,    38,    23,    24,    25,    38,
809       27,    38,    34,    34,    31,    32,    33,    40,    38,    36,
810       38,    15,    38,    38,    38,    38,    38,    34,    34,    34,
811       34,    34,    34,    41,    93,   110,    37,    -1,    -1,    39,
812       -1,    -1,    41
813 };
814
815 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
816    symbol of state STATE-NUM.  */
817 static const yytype_uint8 yystos[] =
818 {
819        0,     3,     4,     5,     6,     7,     8,     9,    15,    16,
820       17,    26,    29,    30,    44,    45,    46,    47,    48,    49,
821       50,    51,    52,    53,    54,    55,    56,    57,    58,    34,
822       34,    34,    34,    34,    34,    34,    34,    59,    59,    59,
823       59,    59,    34,     0,    44,    35,    20,    64,    35,    22,
824       65,    35,    28,    66,    59,    38,    10,    11,    62,    59,
825       38,    59,    38,    60,    34,    60,    34,    60,    34,    10,
826       11,    12,    13,    14,    18,    19,    21,    23,    24,    25,
827       27,    31,    32,    33,    36,    61,    63,    38,    38,    38,
828       40,    69,    38,    38,    38,    38,    34,    34,    34,    37,
829       42,    34,    59,    34,    67,    68,    34,    41,    42,    37,
830       39,    37,    41,    41,    68,    41
831 };
832
833 #define yyerrok         (yyerrstatus = 0)
834 #define yyclearin       (yychar = YYEMPTY)
835 #define YYEMPTY         (-2)
836 #define YYEOF           0
837
838 #define YYACCEPT        goto yyacceptlab
839 #define YYABORT         goto yyabortlab
840 #define YYERROR         goto yyerrorlab
841
842
843 /* Like YYERROR except do call yyerror.  This remains here temporarily
844    to ease the transition to the new meaning of YYERROR, for GCC.
845    Once GCC version 2 has supplanted version 1, this can go.  */
846
847 #define YYFAIL          goto yyerrlab
848
849 #define YYRECOVERING()  (!!yyerrstatus)
850
851 #define YYBACKUP(Token, Value)                                  \
852 do                                                              \
853   if (yychar == YYEMPTY && yylen == 1)                          \
854     {                                                           \
855       yychar = (Token);                                         \
856       yylval = (Value);                                         \
857       yytoken = YYTRANSLATE (yychar);                           \
858       YYPOPSTACK (1);                                           \
859       goto yybackup;                                            \
860     }                                                           \
861   else                                                          \
862     {                                                           \
863       yyerror (YY_("syntax error: cannot back up")); \
864       YYERROR;                                                  \
865     }                                                           \
866 while (YYID (0))
867
868
869 #define YYTERROR        1
870 #define YYERRCODE       256
871
872
873 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
874    If N is 0, then set CURRENT to the empty location which ends
875    the previous symbol: RHS[0] (always defined).  */
876
877 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
878 #ifndef YYLLOC_DEFAULT
879 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
880     do                                                                  \
881       if (YYID (N))                                                    \
882         {                                                               \
883           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
884           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
885           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
886           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
887         }                                                               \
888       else                                                              \
889         {                                                               \
890           (Current).first_line   = (Current).last_line   =              \
891             YYRHSLOC (Rhs, 0).last_line;                                \
892           (Current).first_column = (Current).last_column =              \
893             YYRHSLOC (Rhs, 0).last_column;                              \
894         }                                                               \
895     while (YYID (0))
896 #endif
897
898
899 /* YY_LOCATION_PRINT -- Print the location on the stream.
900    This macro was not mandated originally: define only if we know
901    we won't break user code: when these are the locations we know.  */
902
903 #ifndef YY_LOCATION_PRINT
904 # if YYLTYPE_IS_TRIVIAL
905 #  define YY_LOCATION_PRINT(File, Loc)                  \
906      fprintf (File, "%d.%d-%d.%d",                      \
907               (Loc).first_line, (Loc).first_column,     \
908               (Loc).last_line,  (Loc).last_column)
909 # else
910 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
911 # endif
912 #endif
913
914
915 /* YYLEX -- calling `yylex' with the right arguments.  */
916
917 #ifdef YYLEX_PARAM
918 # define YYLEX yylex (YYLEX_PARAM)
919 #else
920 # define YYLEX yylex ()
921 #endif
922
923 /* Enable debugging if requested.  */
924 #if YYDEBUG
925
926 # ifndef YYFPRINTF
927 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
928 #  define YYFPRINTF fprintf
929 # endif
930
931 # define YYDPRINTF(Args)                        \
932 do {                                            \
933   if (yydebug)                                  \
934     YYFPRINTF Args;                             \
935 } while (YYID (0))
936
937 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
938 do {                                                                      \
939   if (yydebug)                                                            \
940     {                                                                     \
941       YYFPRINTF (stderr, "%s ", Title);                                   \
942       yy_symbol_print (stderr,                                            \
943                   Type, Value, Location); \
944       YYFPRINTF (stderr, "\n");                                           \
945     }                                                                     \
946 } while (YYID (0))
947
948
949 /*--------------------------------.
950 | Print this symbol on YYOUTPUT.  |
951 `--------------------------------*/
952
953 /*ARGSUSED*/
954 #if (defined __STDC__ || defined __C99__FUNC__ \
955      || defined __cplusplus || defined _MSC_VER)
956 static void
957 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
958 #else
959 static void
960 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
961     FILE *yyoutput;
962     int yytype;
963     YYSTYPE const * const yyvaluep;
964     YYLTYPE const * const yylocationp;
965 #endif
966 {
967   if (!yyvaluep)
968     return;
969   YYUSE (yylocationp);
970 # ifdef YYPRINT
971   if (yytype < YYNTOKENS)
972     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
973 # else
974   YYUSE (yyoutput);
975 # endif
976   switch (yytype)
977     {
978       default:
979         break;
980     }
981 }
982
983
984 /*--------------------------------.
985 | Print this symbol on YYOUTPUT.  |
986 `--------------------------------*/
987
988 #if (defined __STDC__ || defined __C99__FUNC__ \
989      || defined __cplusplus || defined _MSC_VER)
990 static void
991 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
992 #else
993 static void
994 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
995     FILE *yyoutput;
996     int yytype;
997     YYSTYPE const * const yyvaluep;
998     YYLTYPE const * const yylocationp;
999 #endif
1000 {
1001   if (yytype < YYNTOKENS)
1002     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1003   else
1004     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1005
1006   YY_LOCATION_PRINT (yyoutput, *yylocationp);
1007   YYFPRINTF (yyoutput, ": ");
1008   yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
1009   YYFPRINTF (yyoutput, ")");
1010 }
1011
1012 /*------------------------------------------------------------------.
1013 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1014 | TOP (included).                                                   |
1015 `------------------------------------------------------------------*/
1016
1017 #if (defined __STDC__ || defined __C99__FUNC__ \
1018      || defined __cplusplus || defined _MSC_VER)
1019 static void
1020 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1021 #else
1022 static void
1023 yy_stack_print (yybottom, yytop)
1024     yytype_int16 *yybottom;
1025     yytype_int16 *yytop;
1026 #endif
1027 {
1028   YYFPRINTF (stderr, "Stack now");
1029   for (; yybottom <= yytop; yybottom++)
1030     {
1031       int yybot = *yybottom;
1032       YYFPRINTF (stderr, " %d", yybot);
1033     }
1034   YYFPRINTF (stderr, "\n");
1035 }
1036
1037 # define YY_STACK_PRINT(Bottom, Top)                            \
1038 do {                                                            \
1039   if (yydebug)                                                  \
1040     yy_stack_print ((Bottom), (Top));                           \
1041 } while (YYID (0))
1042
1043
1044 /*------------------------------------------------.
1045 | Report that the YYRULE is going to be reduced.  |
1046 `------------------------------------------------*/
1047
1048 #if (defined __STDC__ || defined __C99__FUNC__ \
1049      || defined __cplusplus || defined _MSC_VER)
1050 static void
1051 yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
1052 #else
1053 static void
1054 yy_reduce_print (yyvsp, yylsp, yyrule)
1055     YYSTYPE *yyvsp;
1056     YYLTYPE *yylsp;
1057     int yyrule;
1058 #endif
1059 {
1060   int yynrhs = yyr2[yyrule];
1061   int yyi;
1062   unsigned long int yylno = yyrline[yyrule];
1063   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1064              yyrule - 1, yylno);
1065   /* The symbols being reduced.  */
1066   for (yyi = 0; yyi < yynrhs; yyi++)
1067     {
1068       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1069       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1070                        &(yyvsp[(yyi + 1) - (yynrhs)])
1071                        , &(yylsp[(yyi + 1) - (yynrhs)])                );
1072       YYFPRINTF (stderr, "\n");
1073     }
1074 }
1075
1076 # define YY_REDUCE_PRINT(Rule)          \
1077 do {                                    \
1078   if (yydebug)                          \
1079     yy_reduce_print (yyvsp, yylsp, Rule); \
1080 } while (YYID (0))
1081
1082 /* Nonzero means print parse trace.  It is left uninitialized so that
1083    multiple parsers can coexist.  */
1084 int yydebug;
1085 #else /* !YYDEBUG */
1086 # define YYDPRINTF(Args)
1087 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1088 # define YY_STACK_PRINT(Bottom, Top)
1089 # define YY_REDUCE_PRINT(Rule)
1090 #endif /* !YYDEBUG */
1091
1092
1093 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1094 #ifndef YYINITDEPTH
1095 # define YYINITDEPTH 200
1096 #endif
1097
1098 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1099    if the built-in stack extension method is used).
1100
1101    Do not make this value too large; the results are undefined if
1102    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1103    evaluated with infinite-precision integer arithmetic.  */
1104
1105 #ifndef YYMAXDEPTH
1106 # define YYMAXDEPTH 10000
1107 #endif
1108
1109 \f
1110
1111 #if YYERROR_VERBOSE
1112
1113 # ifndef yystrlen
1114 #  if defined __GLIBC__ && defined _STRING_H
1115 #   define yystrlen strlen
1116 #  else
1117 /* Return the length of YYSTR.  */
1118 #if (defined __STDC__ || defined __C99__FUNC__ \
1119      || defined __cplusplus || defined _MSC_VER)
1120 static YYSIZE_T
1121 yystrlen (const char *yystr)
1122 #else
1123 static YYSIZE_T
1124 yystrlen (yystr)
1125     const char *yystr;
1126 #endif
1127 {
1128   YYSIZE_T yylen;
1129   for (yylen = 0; yystr[yylen]; yylen++)
1130     continue;
1131   return yylen;
1132 }
1133 #  endif
1134 # endif
1135
1136 # ifndef yystpcpy
1137 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1138 #   define yystpcpy stpcpy
1139 #  else
1140 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1141    YYDEST.  */
1142 #if (defined __STDC__ || defined __C99__FUNC__ \
1143      || defined __cplusplus || defined _MSC_VER)
1144 static char *
1145 yystpcpy (char *yydest, const char *yysrc)
1146 #else
1147 static char *
1148 yystpcpy (yydest, yysrc)
1149     char *yydest;
1150     const char *yysrc;
1151 #endif
1152 {
1153   char *yyd = yydest;
1154   const char *yys = yysrc;
1155
1156   while ((*yyd++ = *yys++) != '\0')
1157     continue;
1158
1159   return yyd - 1;
1160 }
1161 #  endif
1162 # endif
1163
1164 # ifndef yytnamerr
1165 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1166    quotes and backslashes, so that it's suitable for yyerror.  The
1167    heuristic is that double-quoting is unnecessary unless the string
1168    contains an apostrophe, a comma, or backslash (other than
1169    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1170    null, do not copy; instead, return the length of what the result
1171    would have been.  */
1172 static YYSIZE_T
1173 yytnamerr (char *yyres, const char *yystr)
1174 {
1175   if (*yystr == '"')
1176     {
1177       YYSIZE_T yyn = 0;
1178       char const *yyp = yystr;
1179
1180       for (;;)
1181         switch (*++yyp)
1182           {
1183           case '\'':
1184           case ',':
1185             goto do_not_strip_quotes;
1186
1187           case '\\':
1188             if (*++yyp != '\\')
1189               goto do_not_strip_quotes;
1190             /* Fall through.  */
1191           default:
1192             if (yyres)
1193               yyres[yyn] = *yyp;
1194             yyn++;
1195             break;
1196
1197           case '"':
1198             if (yyres)
1199               yyres[yyn] = '\0';
1200             return yyn;
1201           }
1202     do_not_strip_quotes: ;
1203     }
1204
1205   if (! yyres)
1206     return yystrlen (yystr);
1207
1208   return yystpcpy (yyres, yystr) - yyres;
1209 }
1210 # endif
1211
1212 /* Copy into YYRESULT an error message about the unexpected token
1213    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
1214    including the terminating null byte.  If YYRESULT is null, do not
1215    copy anything; just return the number of bytes that would be
1216    copied.  As a special case, return 0 if an ordinary "syntax error"
1217    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
1218    size calculation.  */
1219 static YYSIZE_T
1220 yysyntax_error (char *yyresult, int yystate, int yychar)
1221 {
1222   int yyn = yypact[yystate];
1223
1224   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1225     return 0;
1226   else
1227     {
1228       int yytype = YYTRANSLATE (yychar);
1229       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1230       YYSIZE_T yysize = yysize0;
1231       YYSIZE_T yysize1;
1232       int yysize_overflow = 0;
1233       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1234       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1235       int yyx;
1236
1237 # if 0
1238       /* This is so xgettext sees the translatable formats that are
1239          constructed on the fly.  */
1240       YY_("syntax error, unexpected %s");
1241       YY_("syntax error, unexpected %s, expecting %s");
1242       YY_("syntax error, unexpected %s, expecting %s or %s");
1243       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1244       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1245 # endif
1246       char *yyfmt;
1247       char const *yyf;
1248       static char const yyunexpected[] = "syntax error, unexpected %s";
1249       static char const yyexpecting[] = ", expecting %s";
1250       static char const yyor[] = " or %s";
1251       char yyformat[sizeof yyunexpected
1252                     + sizeof yyexpecting - 1
1253                     + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1254                        * (sizeof yyor - 1))];
1255       char const *yyprefix = yyexpecting;
1256
1257       /* Start YYX at -YYN if negative to avoid negative indexes in
1258          YYCHECK.  */
1259       int yyxbegin = yyn < 0 ? -yyn : 0;
1260
1261       /* Stay within bounds of both yycheck and yytname.  */
1262       int yychecklim = YYLAST - yyn + 1;
1263       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1264       int yycount = 1;
1265
1266       yyarg[0] = yytname[yytype];
1267       yyfmt = yystpcpy (yyformat, yyunexpected);
1268
1269       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1270         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1271           {
1272             if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1273               {
1274                 yycount = 1;
1275                 yysize = yysize0;
1276                 yyformat[sizeof yyunexpected - 1] = '\0';
1277                 break;
1278               }
1279             yyarg[yycount++] = yytname[yyx];
1280             yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1281             yysize_overflow |= (yysize1 < yysize);
1282             yysize = yysize1;
1283             yyfmt = yystpcpy (yyfmt, yyprefix);
1284             yyprefix = yyor;
1285           }
1286
1287       yyf = YY_(yyformat);
1288       yysize1 = yysize + yystrlen (yyf);
1289       yysize_overflow |= (yysize1 < yysize);
1290       yysize = yysize1;
1291
1292       if (yysize_overflow)
1293         return YYSIZE_MAXIMUM;
1294
1295       if (yyresult)
1296         {
1297           /* Avoid sprintf, as that infringes on the user's name space.
1298              Don't have undefined behavior even if the translation
1299              produced a string with the wrong number of "%s"s.  */
1300           char *yyp = yyresult;
1301           int yyi = 0;
1302           while ((*yyp = *yyf) != '\0')
1303             {
1304               if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1305                 {
1306                   yyp += yytnamerr (yyp, yyarg[yyi++]);
1307                   yyf += 2;
1308                 }
1309               else
1310                 {
1311                   yyp++;
1312                   yyf++;
1313                 }
1314             }
1315         }
1316       return yysize;
1317     }
1318 }
1319 #endif /* YYERROR_VERBOSE */
1320 \f
1321
1322 /*-----------------------------------------------.
1323 | Release the memory associated to this symbol.  |
1324 `-----------------------------------------------*/
1325
1326 /*ARGSUSED*/
1327 #if (defined __STDC__ || defined __C99__FUNC__ \
1328      || defined __cplusplus || defined _MSC_VER)
1329 static void
1330 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
1331 #else
1332 static void
1333 yydestruct (yymsg, yytype, yyvaluep, yylocationp)
1334     const char *yymsg;
1335     int yytype;
1336     YYSTYPE *yyvaluep;
1337     YYLTYPE *yylocationp;
1338 #endif
1339 {
1340   YYUSE (yyvaluep);
1341   YYUSE (yylocationp);
1342
1343   if (!yymsg)
1344     yymsg = "Deleting";
1345   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1346
1347   switch (yytype)
1348     {
1349
1350       default:
1351         break;
1352     }
1353 }
1354
1355 /* Prevent warnings from -Wmissing-prototypes.  */
1356 #ifdef YYPARSE_PARAM
1357 #if defined __STDC__ || defined __cplusplus
1358 int yyparse (void *YYPARSE_PARAM);
1359 #else
1360 int yyparse ();
1361 #endif
1362 #else /* ! YYPARSE_PARAM */
1363 #if defined __STDC__ || defined __cplusplus
1364 int yyparse (void);
1365 #else
1366 int yyparse ();
1367 #endif
1368 #endif /* ! YYPARSE_PARAM */
1369
1370
1371 /* The lookahead symbol.  */
1372 int yychar;
1373
1374 /* The semantic value of the lookahead symbol.  */
1375 YYSTYPE yylval;
1376
1377 /* Location data for the lookahead symbol.  */
1378 YYLTYPE yylloc;
1379
1380 /* Number of syntax errors so far.  */
1381 int yynerrs;
1382
1383
1384
1385 /*-------------------------.
1386 | yyparse or yypush_parse.  |
1387 `-------------------------*/
1388
1389 #ifdef YYPARSE_PARAM
1390 #if (defined __STDC__ || defined __C99__FUNC__ \
1391      || defined __cplusplus || defined _MSC_VER)
1392 int
1393 yyparse (void *YYPARSE_PARAM)
1394 #else
1395 int
1396 yyparse (YYPARSE_PARAM)
1397     void *YYPARSE_PARAM;
1398 #endif
1399 #else /* ! YYPARSE_PARAM */
1400 #if (defined __STDC__ || defined __C99__FUNC__ \
1401      || defined __cplusplus || defined _MSC_VER)
1402 int
1403 yyparse (void)
1404 #else
1405 int
1406 yyparse ()
1407
1408 #endif
1409 #endif
1410 {
1411
1412
1413     int yystate;
1414     /* Number of tokens to shift before error messages enabled.  */
1415     int yyerrstatus;
1416
1417     /* The stacks and their tools:
1418        `yyss': related to states.
1419        `yyvs': related to semantic values.
1420        `yyls': related to locations.
1421
1422        Refer to the stacks thru separate pointers, to allow yyoverflow
1423        to reallocate them elsewhere.  */
1424
1425     /* The state stack.  */
1426     yytype_int16 yyssa[YYINITDEPTH];
1427     yytype_int16 *yyss;
1428     yytype_int16 *yyssp;
1429
1430     /* The semantic value stack.  */
1431     YYSTYPE yyvsa[YYINITDEPTH];
1432     YYSTYPE *yyvs;
1433     YYSTYPE *yyvsp;
1434
1435     /* The location stack.  */
1436     YYLTYPE yylsa[YYINITDEPTH];
1437     YYLTYPE *yyls;
1438     YYLTYPE *yylsp;
1439
1440     /* The locations where the error started and ended.  */
1441     YYLTYPE yyerror_range[2];
1442
1443     YYSIZE_T yystacksize;
1444
1445   int yyn;
1446   int yyresult;
1447   /* Lookahead token as an internal (translated) token number.  */
1448   int yytoken;
1449   /* The variables used to return semantic value and location from the
1450      action routines.  */
1451   YYSTYPE yyval;
1452   YYLTYPE yyloc;
1453
1454 #if YYERROR_VERBOSE
1455   /* Buffer for error messages, and its allocated size.  */
1456   char yymsgbuf[128];
1457   char *yymsg = yymsgbuf;
1458   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1459 #endif
1460
1461 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1462
1463   /* The number of symbols on the RHS of the reduced rule.
1464      Keep to zero when no symbol should be popped.  */
1465   int yylen = 0;
1466
1467   yytoken = 0;
1468   yyss = yyssa;
1469   yyvs = yyvsa;
1470   yyls = yylsa;
1471   yystacksize = YYINITDEPTH;
1472
1473   YYDPRINTF ((stderr, "Starting parse\n"));
1474
1475   yystate = 0;
1476   yyerrstatus = 0;
1477   yynerrs = 0;
1478   yychar = YYEMPTY; /* Cause a token to be read.  */
1479
1480   /* Initialize stack pointers.
1481      Waste one element of value and location stack
1482      so that they stay on the same level as the state stack.
1483      The wasted elements are never initialized.  */
1484   yyssp = yyss;
1485   yyvsp = yyvs;
1486   yylsp = yyls;
1487
1488 #if YYLTYPE_IS_TRIVIAL
1489   /* Initialize the default location before parsing starts.  */
1490   yylloc.first_line   = yylloc.last_line   = 1;
1491   yylloc.first_column = yylloc.last_column = 1;
1492 #endif
1493
1494   goto yysetstate;
1495
1496 /*------------------------------------------------------------.
1497 | yynewstate -- Push a new state, which is found in yystate.  |
1498 `------------------------------------------------------------*/
1499  yynewstate:
1500   /* In all cases, when you get here, the value and location stacks
1501      have just been pushed.  So pushing a state here evens the stacks.  */
1502   yyssp++;
1503
1504  yysetstate:
1505   *yyssp = yystate;
1506
1507   if (yyss + yystacksize - 1 <= yyssp)
1508     {
1509       /* Get the current used size of the three stacks, in elements.  */
1510       YYSIZE_T yysize = yyssp - yyss + 1;
1511
1512 #ifdef yyoverflow
1513       {
1514         /* Give user a chance to reallocate the stack.  Use copies of
1515            these so that the &'s don't force the real ones into
1516            memory.  */
1517         YYSTYPE *yyvs1 = yyvs;
1518         yytype_int16 *yyss1 = yyss;
1519         YYLTYPE *yyls1 = yyls;
1520
1521         /* Each stack pointer address is followed by the size of the
1522            data in use in that stack, in bytes.  This used to be a
1523            conditional around just the two extra args, but that might
1524            be undefined if yyoverflow is a macro.  */
1525         yyoverflow (YY_("memory exhausted"),
1526                     &yyss1, yysize * sizeof (*yyssp),
1527                     &yyvs1, yysize * sizeof (*yyvsp),
1528                     &yyls1, yysize * sizeof (*yylsp),
1529                     &yystacksize);
1530
1531         yyls = yyls1;
1532         yyss = yyss1;
1533         yyvs = yyvs1;
1534       }
1535 #else /* no yyoverflow */
1536 # ifndef YYSTACK_RELOCATE
1537       goto yyexhaustedlab;
1538 # else
1539       /* Extend the stack our own way.  */
1540       if (YYMAXDEPTH <= yystacksize)
1541         goto yyexhaustedlab;
1542       yystacksize *= 2;
1543       if (YYMAXDEPTH < yystacksize)
1544         yystacksize = YYMAXDEPTH;
1545
1546       {
1547         yytype_int16 *yyss1 = yyss;
1548         union yyalloc *yyptr =
1549           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1550         if (! yyptr)
1551           goto yyexhaustedlab;
1552         YYSTACK_RELOCATE (yyss_alloc, yyss);
1553         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1554         YYSTACK_RELOCATE (yyls_alloc, yyls);
1555 #  undef YYSTACK_RELOCATE
1556         if (yyss1 != yyssa)
1557           YYSTACK_FREE (yyss1);
1558       }
1559 # endif
1560 #endif /* no yyoverflow */
1561
1562       yyssp = yyss + yysize - 1;
1563       yyvsp = yyvs + yysize - 1;
1564       yylsp = yyls + yysize - 1;
1565
1566       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1567                   (unsigned long int) yystacksize));
1568
1569       if (yyss + yystacksize - 1 <= yyssp)
1570         YYABORT;
1571     }
1572
1573   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1574
1575   if (yystate == YYFINAL)
1576     YYACCEPT;
1577
1578   goto yybackup;
1579
1580 /*-----------.
1581 | yybackup.  |
1582 `-----------*/
1583 yybackup:
1584
1585   /* Do appropriate processing given the current state.  Read a
1586      lookahead token if we need one and don't already have one.  */
1587
1588   /* First try to decide what to do without reference to lookahead token.  */
1589   yyn = yypact[yystate];
1590   if (yyn == YYPACT_NINF)
1591     goto yydefault;
1592
1593   /* Not known => get a lookahead token if don't already have one.  */
1594
1595   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1596   if (yychar == YYEMPTY)
1597     {
1598       YYDPRINTF ((stderr, "Reading a token: "));
1599       yychar = YYLEX;
1600     }
1601
1602   if (yychar <= YYEOF)
1603     {
1604       yychar = yytoken = YYEOF;
1605       YYDPRINTF ((stderr, "Now at end of input.\n"));
1606     }
1607   else
1608     {
1609       yytoken = YYTRANSLATE (yychar);
1610       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1611     }
1612
1613   /* If the proper action on seeing token YYTOKEN is to reduce or to
1614      detect an error, take that action.  */
1615   yyn += yytoken;
1616   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1617     goto yydefault;
1618   yyn = yytable[yyn];
1619   if (yyn <= 0)
1620     {
1621       if (yyn == 0 || yyn == YYTABLE_NINF)
1622         goto yyerrlab;
1623       yyn = -yyn;
1624       goto yyreduce;
1625     }
1626
1627   /* Count tokens shifted since error; after three, turn off error
1628      status.  */
1629   if (yyerrstatus)
1630     yyerrstatus--;
1631
1632   /* Shift the lookahead token.  */
1633   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1634
1635   /* Discard the shifted token.  */
1636   yychar = YYEMPTY;
1637
1638   yystate = yyn;
1639   *++yyvsp = yylval;
1640   *++yylsp = yylloc;
1641   goto yynewstate;
1642
1643
1644 /*-----------------------------------------------------------.
1645 | yydefault -- do the default action for the current state.  |
1646 `-----------------------------------------------------------*/
1647 yydefault:
1648   yyn = yydefact[yystate];
1649   if (yyn == 0)
1650     goto yyerrlab;
1651   goto yyreduce;
1652
1653
1654 /*-----------------------------.
1655 | yyreduce -- Do a reduction.  |
1656 `-----------------------------*/
1657 yyreduce:
1658   /* yyn is the number of a rule to reduce with.  */
1659   yylen = yyr2[yyn];
1660
1661   /* If YYLEN is nonzero, implement the default value of the action:
1662      `$$ = $1'.
1663
1664      Otherwise, the following line sets YYVAL to garbage.
1665      This behavior is undocumented and Bison
1666      users should not rely upon it.  Assigning to YYVAL
1667      unconditionally makes the parser a bit smaller, and it avoids a
1668      GCC warning that YYVAL may be used uninitialized.  */
1669   yyval = yyvsp[1-yylen];
1670
1671   /* Default location.  */
1672   YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1673   YY_REDUCE_PRINT (yyn);
1674   switch (yyn)
1675     {
1676         case 17:
1677
1678 /* Line 1455 of yacc.c  */
1679 #line 234 "../../src/parser.yy"
1680     {
1681               if (gengetopt_package_given)
1682                 {
1683                   yyerror ("package redefined");
1684                   YYERROR;
1685                 }
1686               else
1687                 {
1688                   gengetopt_package_given = 1;
1689                   if (gengetopt_define_package ((yyvsp[(2) - (2)].str)))
1690                     {
1691                       yyerror ("not enough memory");
1692                       YYERROR;
1693                     }
1694                 }
1695             }
1696     break;
1697
1698   case 18:
1699
1700 /* Line 1455 of yacc.c  */
1701 #line 254 "../../src/parser.yy"
1702     {
1703               if (gengetopt_version_given)
1704                 {
1705                   yyerror ("version redefined");
1706                   YYERROR;
1707                 }
1708               else
1709                 {
1710                   gengetopt_version_given = 1;
1711                   if (gengetopt_define_version ((yyvsp[(2) - (2)].str)))
1712                     {
1713                       yyerror ("not enough memory");
1714                       YYERROR;
1715                     }
1716                 }
1717             }
1718     break;
1719
1720   case 19:
1721
1722 /* Line 1455 of yacc.c  */
1723 #line 274 "../../src/parser.yy"
1724     {
1725               if (gengetopt_purpose_given)
1726                 {
1727                   yyerror ("purpose redefined");
1728                   YYERROR;
1729                 }
1730               else
1731                 {
1732                   gengetopt_purpose_given = 1;
1733                   if (gengetopt_define_purpose ((yyvsp[(2) - (2)].str)))
1734                     {
1735                       yyerror ("not enough memory");
1736                       YYERROR;
1737                     }
1738                 }
1739             }
1740     break;
1741
1742   case 20:
1743
1744 /* Line 1455 of yacc.c  */
1745 #line 294 "../../src/parser.yy"
1746     {
1747               if (gengetopt_description_given)
1748                 {
1749                   yyerror ("description redefined");
1750                   YYERROR;
1751                 }
1752               else
1753                 {
1754                   gengetopt_description_given = 1;
1755                   if (gengetopt_define_description ((yyvsp[(2) - (2)].str)))
1756                     {
1757                       yyerror ("not enough memory");
1758                       YYERROR;
1759                     }
1760                 }
1761             }
1762     break;
1763
1764   case 21:
1765
1766 /* Line 1455 of yacc.c  */
1767 #line 314 "../../src/parser.yy"
1768     {
1769       if (gengetopt_usage_given)
1770       {
1771           yyerror ("usage redefined");
1772           YYERROR;
1773       }
1774       else
1775       {
1776           gengetopt_usage_given = 1;
1777           if (gengetopt_define_usage ((yyvsp[(2) - (2)].str)))
1778           {
1779               yyerror ("not enough memory");
1780               YYERROR;
1781           }
1782       }
1783   }
1784     break;
1785
1786   case 22:
1787
1788 /* Line 1455 of yacc.c  */
1789 #line 335 "../../src/parser.yy"
1790     {
1791                 gengetopt_set_section ((yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str));
1792               }
1793     break;
1794
1795   case 23:
1796
1797 /* Line 1455 of yacc.c  */
1798 #line 342 "../../src/parser.yy"
1799     {
1800                 if (current_option) {
1801                         std::string current_option_text;
1802                         if (current_option->text_after) {
1803                                 current_option_text = std::string(current_option->text_after) + (yyvsp[(2) - (2)].str);
1804                                 current_option->text_after = strdup(current_option_text.c_str()); 
1805                         } else {
1806                                 current_option->text_after = strdup((yyvsp[(2) - (2)].str));
1807                         }
1808                 } else {
1809                                         gengetopt_set_text((yyvsp[(2) - (2)].str));
1810                                 }
1811             }
1812     break;
1813
1814   case 24:
1815
1816 /* Line 1455 of yacc.c  */
1817 #line 359 "../../src/parser.yy"
1818     {
1819   gengetopt_set_args((yyvsp[(2) - (2)].str));
1820             }
1821     break;
1822
1823   case 25:
1824
1825 /* Line 1455 of yacc.c  */
1826 #line 366 "../../src/parser.yy"
1827     {
1828               if (gengetopt_add_group ((yyvsp[(2) - (4)].str), (yyvsp[(3) - (4)].str), (yyvsp[(4) - (4)].boolean)))
1829                 {
1830                         yyerror ("group redefined");
1831                         YYERROR;
1832                   }
1833             }
1834     break;
1835
1836   case 26:
1837
1838 /* Line 1455 of yacc.c  */
1839 #line 377 "../../src/parser.yy"
1840     {
1841               if (gengetopt_add_mode ((yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str)))
1842                 {
1843                         yyerror ("mode redefined");
1844                         YYERROR;
1845                   }
1846             }
1847     break;
1848
1849   case 27:
1850
1851 /* Line 1455 of yacc.c  */
1852 #line 389 "../../src/parser.yy"
1853     {
1854           (yyvsp[(5) - (5)].gengetopt_option)->filename = gengetopt_input_filename;
1855           (yyvsp[(5) - (5)].gengetopt_option)->linenum = (yylsp[(1) - (5)]).first_line;
1856               (yyvsp[(5) - (5)].gengetopt_option)->long_opt = strdup((yyvsp[(2) - (5)].str));
1857               if ((yyvsp[(3) - (5)].chr) != '-')
1858                 (yyvsp[(5) - (5)].gengetopt_option)->short_opt = (yyvsp[(3) - (5)].chr);
1859               (yyvsp[(5) - (5)].gengetopt_option)->desc = strdup((yyvsp[(4) - (5)].str));
1860               int o = gengetopt_check_option ((yyvsp[(5) - (5)].gengetopt_option), false);
1861               check_result(o, (yyvsp[(5) - (5)].gengetopt_option));
1862           check_error;
1863               o = gengetopt_add_option ((yyvsp[(5) - (5)].gengetopt_option));
1864               check_result(o, (yyvsp[(5) - (5)].gengetopt_option));
1865               check_error;
1866               current_option = (yyvsp[(5) - (5)].gengetopt_option);
1867             }
1868     break;
1869
1870   case 28:
1871
1872 /* Line 1455 of yacc.c  */
1873 #line 409 "../../src/parser.yy"
1874     {
1875           (yyvsp[(5) - (5)].gengetopt_option)->filename = gengetopt_input_filename;
1876           (yyvsp[(5) - (5)].gengetopt_option)->linenum = (yylsp[(1) - (5)]).first_line;
1877               (yyvsp[(5) - (5)].gengetopt_option)->long_opt = strdup((yyvsp[(2) - (5)].str));
1878           if ((yyvsp[(3) - (5)].chr) != '-')
1879             (yyvsp[(5) - (5)].gengetopt_option)->short_opt = (yyvsp[(3) - (5)].chr);
1880           (yyvsp[(5) - (5)].gengetopt_option)->desc = strdup((yyvsp[(4) - (5)].str));
1881           int o = gengetopt_check_option ((yyvsp[(5) - (5)].gengetopt_option), true);
1882           check_result(o, (yyvsp[(5) - (5)].gengetopt_option));
1883           check_error;
1884           o = gengetopt_add_option ((yyvsp[(5) - (5)].gengetopt_option));
1885           check_result(o, (yyvsp[(5) - (5)].gengetopt_option));
1886           check_error;
1887             }
1888     break;
1889
1890   case 29:
1891
1892 /* Line 1455 of yacc.c  */
1893 #line 428 "../../src/parser.yy"
1894     {
1895           (yyvsp[(5) - (5)].gengetopt_option)->filename = gengetopt_input_filename;
1896           (yyvsp[(5) - (5)].gengetopt_option)->linenum = (yylsp[(1) - (5)]).first_line;
1897               (yyvsp[(5) - (5)].gengetopt_option)->long_opt = strdup((yyvsp[(2) - (5)].str));
1898           if ((yyvsp[(3) - (5)].chr) != '-')
1899             (yyvsp[(5) - (5)].gengetopt_option)->short_opt = (yyvsp[(3) - (5)].chr);
1900           (yyvsp[(5) - (5)].gengetopt_option)->desc = strdup((yyvsp[(4) - (5)].str));
1901           int o = gengetopt_check_option ((yyvsp[(5) - (5)].gengetopt_option), false, true);
1902           check_result(o, (yyvsp[(5) - (5)].gengetopt_option));
1903           check_error;
1904           o = gengetopt_add_option ((yyvsp[(5) - (5)].gengetopt_option));
1905           check_result(o, (yyvsp[(5) - (5)].gengetopt_option));
1906           check_error;
1907             }
1908     break;
1909
1910   case 31:
1911
1912 /* Line 1455 of yacc.c  */
1913 #line 452 "../../src/parser.yy"
1914     {
1915                                 (yyval.gengetopt_option) = (yyvsp[(1) - (2)].gengetopt_option);
1916                                 (yyval.gengetopt_option)->required = (yyvsp[(2) - (2)].boolean);
1917                                 (yyval.gengetopt_option)->required_set = true;
1918                           }
1919     break;
1920
1921   case 32:
1922
1923 /* Line 1455 of yacc.c  */
1924 #line 458 "../../src/parser.yy"
1925     {
1926                                 (yyval.gengetopt_option) = (yyvsp[(1) - (2)].gengetopt_option);
1927                                 (yyval.gengetopt_option)->type = (yyvsp[(2) - (2)].argtype);
1928                           }
1929     break;
1930
1931   case 33:
1932
1933 /* Line 1455 of yacc.c  */
1934 #line 463 "../../src/parser.yy"
1935     {
1936                                 (yyval.gengetopt_option) = (yyvsp[(1) - (4)].gengetopt_option);
1937                                 (yyval.gengetopt_option)->type_str = strdup((yyvsp[(4) - (4)].str));
1938                           }
1939     break;
1940
1941   case 34:
1942
1943 /* Line 1455 of yacc.c  */
1944 #line 468 "../../src/parser.yy"
1945     {
1946                                 (yyval.gengetopt_option) = (yyvsp[(1) - (4)].gengetopt_option);
1947                                 (yyval.gengetopt_option)->details = strdup((yyvsp[(4) - (4)].str));
1948                           }
1949     break;
1950
1951   case 35:
1952
1953 /* Line 1455 of yacc.c  */
1954 #line 473 "../../src/parser.yy"
1955     {
1956                                 (yyval.gengetopt_option) = (yyvsp[(1) - (4)].gengetopt_option);
1957                                 (yyval.gengetopt_option)->acceptedvalues = (yyvsp[(4) - (4)].ValueList);
1958                           }
1959     break;
1960
1961   case 36:
1962
1963 /* Line 1455 of yacc.c  */
1964 #line 478 "../../src/parser.yy"
1965     {
1966                                 (yyval.gengetopt_option) = (yyvsp[(1) - (4)].gengetopt_option);
1967                                 (yyval.gengetopt_option)->default_string = strdup((yyvsp[(4) - (4)].str));
1968                           }
1969     break;
1970
1971   case 37:
1972
1973 /* Line 1455 of yacc.c  */
1974 #line 483 "../../src/parser.yy"
1975     {
1976                 (yyval.gengetopt_option) = (yyvsp[(1) - (4)].gengetopt_option);
1977                 (yyval.gengetopt_option)->group_value = strdup((yyvsp[(4) - (4)].str));
1978               }
1979     break;
1980
1981   case 38:
1982
1983 /* Line 1455 of yacc.c  */
1984 #line 488 "../../src/parser.yy"
1985     {
1986                 (yyval.gengetopt_option) = (yyvsp[(1) - (4)].gengetopt_option);
1987                 (yyval.gengetopt_option)->mode_value = strdup((yyvsp[(4) - (4)].str));
1988               }
1989     break;
1990
1991   case 39:
1992
1993 /* Line 1455 of yacc.c  */
1994 #line 493 "../../src/parser.yy"
1995     {
1996                 (yyval.gengetopt_option) = (yyvsp[(1) - (4)].gengetopt_option);
1997                 (yyval.gengetopt_option)->dependon = strdup((yyvsp[(4) - (4)].str));
1998               }
1999     break;
2000
2001   case 40:
2002
2003 /* Line 1455 of yacc.c  */
2004 #line 498 "../../src/parser.yy"
2005     {
2006                                 (yyval.gengetopt_option) = (yyvsp[(1) - (2)].gengetopt_option);
2007                                 (yyval.gengetopt_option)->arg_is_optional = true;
2008                           }
2009     break;
2010
2011   case 41:
2012
2013 /* Line 1455 of yacc.c  */
2014 #line 503 "../../src/parser.yy"
2015     {
2016                                 (yyval.gengetopt_option) = (yyvsp[(1) - (3)].gengetopt_option);
2017                                 (yyval.gengetopt_option)->multiple = true;
2018                 (yyval.gengetopt_option)->multiple_min = (yyvsp[(3) - (3)].multiple_size)->min;
2019                 (yyval.gengetopt_option)->multiple_max = (yyvsp[(3) - (3)].multiple_size)->max;
2020                 delete (yyvsp[(3) - (3)].multiple_size);
2021                           }
2022     break;
2023
2024   case 42:
2025
2026 /* Line 1455 of yacc.c  */
2027 #line 511 "../../src/parser.yy"
2028     {
2029           (yyval.gengetopt_option) = (yyvsp[(1) - (2)].gengetopt_option);
2030           (yyval.gengetopt_option)->type = ARG_FLAG;
2031         }
2032     break;
2033
2034   case 43:
2035
2036 /* Line 1455 of yacc.c  */
2037 #line 516 "../../src/parser.yy"
2038     {
2039           (yyval.gengetopt_option) = (yyvsp[(1) - (2)].gengetopt_option);
2040           (yyval.gengetopt_option)->hidden = true;
2041         }
2042     break;
2043
2044   case 44:
2045
2046 /* Line 1455 of yacc.c  */
2047 #line 521 "../../src/parser.yy"
2048     {
2049           (yyval.gengetopt_option) = (yyvsp[(1) - (2)].gengetopt_option);
2050           (yyval.gengetopt_option)->flagstat = (yyvsp[(2) - (2)].boolean);
2051         }
2052     break;
2053
2054   case 45:
2055
2056 /* Line 1455 of yacc.c  */
2057 #line 525 "../../src/parser.yy"
2058     { (yyval.gengetopt_option) = new gengetopt_option; }
2059     break;
2060
2061   case 46:
2062
2063 /* Line 1455 of yacc.c  */
2064 #line 529 "../../src/parser.yy"
2065     { (yyval.boolean) = 1; }
2066     break;
2067
2068   case 47:
2069
2070 /* Line 1455 of yacc.c  */
2071 #line 530 "../../src/parser.yy"
2072     { (yyval.boolean) = 0; }
2073     break;
2074
2075   case 48:
2076
2077 /* Line 1455 of yacc.c  */
2078 #line 534 "../../src/parser.yy"
2079     { (yyval.boolean) = 0; }
2080     break;
2081
2082   case 49:
2083
2084 /* Line 1455 of yacc.c  */
2085 #line 535 "../../src/parser.yy"
2086     { (yyval.boolean) = 1; }
2087     break;
2088
2089   case 50:
2090
2091 /* Line 1455 of yacc.c  */
2092 #line 536 "../../src/parser.yy"
2093     { (yyval.boolean) = 0; }
2094     break;
2095
2096   case 51:
2097
2098 /* Line 1455 of yacc.c  */
2099 #line 540 "../../src/parser.yy"
2100     { (yyval.boolean) = 1; }
2101     break;
2102
2103   case 52:
2104
2105 /* Line 1455 of yacc.c  */
2106 #line 541 "../../src/parser.yy"
2107     { (yyval.boolean) = 0; }
2108     break;
2109
2110   case 53:
2111
2112 /* Line 1455 of yacc.c  */
2113 #line 545 "../../src/parser.yy"
2114     { (yyval.str) = 0; }
2115     break;
2116
2117   case 54:
2118
2119 /* Line 1455 of yacc.c  */
2120 #line 546 "../../src/parser.yy"
2121     { (yyval.str) = (yyvsp[(3) - (3)].str); }
2122     break;
2123
2124   case 55:
2125
2126 /* Line 1455 of yacc.c  */
2127 #line 550 "../../src/parser.yy"
2128     { (yyval.str) = 0; }
2129     break;
2130
2131   case 56:
2132
2133 /* Line 1455 of yacc.c  */
2134 #line 551 "../../src/parser.yy"
2135     { (yyval.str) = (yyvsp[(3) - (3)].str); }
2136     break;
2137
2138   case 57:
2139
2140 /* Line 1455 of yacc.c  */
2141 #line 555 "../../src/parser.yy"
2142     { (yyval.str) = 0; }
2143     break;
2144
2145   case 58:
2146
2147 /* Line 1455 of yacc.c  */
2148 #line 556 "../../src/parser.yy"
2149     { (yyval.str) = (yyvsp[(3) - (3)].str); }
2150     break;
2151
2152   case 59:
2153
2154 /* Line 1455 of yacc.c  */
2155 #line 560 "../../src/parser.yy"
2156     { (yyval.ValueList) = new AcceptedValues; (yyval.ValueList)->insert((yyvsp[(1) - (1)].str)); }
2157     break;
2158
2159   case 60:
2160
2161 /* Line 1455 of yacc.c  */
2162 #line 561 "../../src/parser.yy"
2163     { (yyvsp[(1) - (3)].ValueList)->insert((yyvsp[(3) - (3)].str)); (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); }
2164     break;
2165
2166   case 61:
2167
2168 /* Line 1455 of yacc.c  */
2169 #line 565 "../../src/parser.yy"
2170     { (yyval.str) = (yyvsp[(1) - (1)].str); }
2171     break;
2172
2173   case 62:
2174
2175 /* Line 1455 of yacc.c  */
2176 #line 569 "../../src/parser.yy"
2177     { (yyval.multiple_size) = new multiple_size; }
2178     break;
2179
2180   case 63:
2181
2182 /* Line 1455 of yacc.c  */
2183 #line 570 "../../src/parser.yy"
2184     { (yyval.multiple_size) = new multiple_size((yyvsp[(2) - (3)].str), (yyvsp[(2) - (3)].str)); }
2185     break;
2186
2187   case 64:
2188
2189 /* Line 1455 of yacc.c  */
2190 #line 571 "../../src/parser.yy"
2191     { (yyval.multiple_size) = new multiple_size((yyvsp[(2) - (4)].str), "0"); free((yyvsp[(2) - (4)].str)); }
2192     break;
2193
2194   case 65:
2195
2196 /* Line 1455 of yacc.c  */
2197 #line 572 "../../src/parser.yy"
2198     { (yyval.multiple_size) = new multiple_size("0", (yyvsp[(3) - (4)].str)); free((yyvsp[(3) - (4)].str)); }
2199     break;
2200
2201   case 66:
2202
2203 /* Line 1455 of yacc.c  */
2204 #line 573 "../../src/parser.yy"
2205     { (yyval.multiple_size) = new multiple_size((yyvsp[(2) - (5)].str), (yyvsp[(4) - (5)].str)); free((yyvsp[(2) - (5)].str)); free((yyvsp[(4) - (5)].str)); }
2206     break;
2207
2208
2209
2210 /* Line 1455 of yacc.c  */
2211 #line 2212 "../../src/parser.cc"
2212       default: break;
2213     }
2214   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2215
2216   YYPOPSTACK (yylen);
2217   yylen = 0;
2218   YY_STACK_PRINT (yyss, yyssp);
2219
2220   *++yyvsp = yyval;
2221   *++yylsp = yyloc;
2222
2223   /* Now `shift' the result of the reduction.  Determine what state
2224      that goes to, based on the state we popped back to and the rule
2225      number reduced by.  */
2226
2227   yyn = yyr1[yyn];
2228
2229   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2230   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2231     yystate = yytable[yystate];
2232   else
2233     yystate = yydefgoto[yyn - YYNTOKENS];
2234
2235   goto yynewstate;
2236
2237
2238 /*------------------------------------.
2239 | yyerrlab -- here on detecting error |
2240 `------------------------------------*/
2241 yyerrlab:
2242   /* If not already recovering from an error, report this error.  */
2243   if (!yyerrstatus)
2244     {
2245       ++yynerrs;
2246 #if ! YYERROR_VERBOSE
2247       yyerror (YY_("syntax error"));
2248 #else
2249       {
2250         YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2251         if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2252           {
2253             YYSIZE_T yyalloc = 2 * yysize;
2254             if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2255               yyalloc = YYSTACK_ALLOC_MAXIMUM;
2256             if (yymsg != yymsgbuf)
2257               YYSTACK_FREE (yymsg);
2258             yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2259             if (yymsg)
2260               yymsg_alloc = yyalloc;
2261             else
2262               {
2263                 yymsg = yymsgbuf;
2264                 yymsg_alloc = sizeof yymsgbuf;
2265               }
2266           }
2267
2268         if (0 < yysize && yysize <= yymsg_alloc)
2269           {
2270             (void) yysyntax_error (yymsg, yystate, yychar);
2271             yyerror (yymsg);
2272           }
2273         else
2274           {
2275             yyerror (YY_("syntax error"));
2276             if (yysize != 0)
2277               goto yyexhaustedlab;
2278           }
2279       }
2280 #endif
2281     }
2282
2283   yyerror_range[0] = yylloc;
2284
2285   if (yyerrstatus == 3)
2286     {
2287       /* If just tried and failed to reuse lookahead token after an
2288          error, discard it.  */
2289
2290       if (yychar <= YYEOF)
2291         {
2292           /* Return failure if at end of input.  */
2293           if (yychar == YYEOF)
2294             YYABORT;
2295         }
2296       else
2297         {
2298           yydestruct ("Error: discarding",
2299                       yytoken, &yylval, &yylloc);
2300           yychar = YYEMPTY;
2301         }
2302     }
2303
2304   /* Else will try to reuse lookahead token after shifting the error
2305      token.  */
2306   goto yyerrlab1;
2307
2308
2309 /*---------------------------------------------------.
2310 | yyerrorlab -- error raised explicitly by YYERROR.  |
2311 `---------------------------------------------------*/
2312 yyerrorlab:
2313
2314   /* Pacify compilers like GCC when the user code never invokes
2315      YYERROR and the label yyerrorlab therefore never appears in user
2316      code.  */
2317   if (/*CONSTCOND*/ 0)
2318      goto yyerrorlab;
2319
2320   yyerror_range[0] = yylsp[1-yylen];
2321   /* Do not reclaim the symbols of the rule which action triggered
2322      this YYERROR.  */
2323   YYPOPSTACK (yylen);
2324   yylen = 0;
2325   YY_STACK_PRINT (yyss, yyssp);
2326   yystate = *yyssp;
2327   goto yyerrlab1;
2328
2329
2330 /*-------------------------------------------------------------.
2331 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
2332 `-------------------------------------------------------------*/
2333 yyerrlab1:
2334   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2335
2336   for (;;)
2337     {
2338       yyn = yypact[yystate];
2339       if (yyn != YYPACT_NINF)
2340         {
2341           yyn += YYTERROR;
2342           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2343             {
2344               yyn = yytable[yyn];
2345               if (0 < yyn)
2346                 break;
2347             }
2348         }
2349
2350       /* Pop the current state because it cannot handle the error token.  */
2351       if (yyssp == yyss)
2352         YYABORT;
2353
2354       yyerror_range[0] = *yylsp;
2355       yydestruct ("Error: popping",
2356                   yystos[yystate], yyvsp, yylsp);
2357       YYPOPSTACK (1);
2358       yystate = *yyssp;
2359       YY_STACK_PRINT (yyss, yyssp);
2360     }
2361
2362   *++yyvsp = yylval;
2363
2364   yyerror_range[1] = yylloc;
2365   /* Using YYLLOC is tempting, but would change the location of
2366      the lookahead.  YYLOC is available though.  */
2367   YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
2368   *++yylsp = yyloc;
2369
2370   /* Shift the error token.  */
2371   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2372
2373   yystate = yyn;
2374   goto yynewstate;
2375
2376
2377 /*-------------------------------------.
2378 | yyacceptlab -- YYACCEPT comes here.  |
2379 `-------------------------------------*/
2380 yyacceptlab:
2381   yyresult = 0;
2382   goto yyreturn;
2383
2384 /*-----------------------------------.
2385 | yyabortlab -- YYABORT comes here.  |
2386 `-----------------------------------*/
2387 yyabortlab:
2388   yyresult = 1;
2389   goto yyreturn;
2390
2391 #if !defined(yyoverflow) || YYERROR_VERBOSE
2392 /*-------------------------------------------------.
2393 | yyexhaustedlab -- memory exhaustion comes here.  |
2394 `-------------------------------------------------*/
2395 yyexhaustedlab:
2396   yyerror (YY_("memory exhausted"));
2397   yyresult = 2;
2398   /* Fall through.  */
2399 #endif
2400
2401 yyreturn:
2402   if (yychar != YYEMPTY)
2403      yydestruct ("Cleanup: discarding lookahead",
2404                  yytoken, &yylval, &yylloc);
2405   /* Do not reclaim the symbols of the rule which action triggered
2406      this YYABORT or YYACCEPT.  */
2407   YYPOPSTACK (yylen);
2408   YY_STACK_PRINT (yyss, yyssp);
2409   while (yyssp != yyss)
2410     {
2411       yydestruct ("Cleanup: popping",
2412                   yystos[*yyssp], yyvsp, yylsp);
2413       YYPOPSTACK (1);
2414     }
2415 #ifndef yyoverflow
2416   if (yyss != yyssa)
2417     YYSTACK_FREE (yyss);
2418 #endif
2419 #if YYERROR_VERBOSE
2420   if (yymsg != yymsgbuf)
2421     YYSTACK_FREE (yymsg);
2422 #endif
2423   /* Make sure YYID is used.  */
2424   return YYID (yyresult);
2425 }
2426
2427
2428
2429 /* Line 1675 of yacc.c  */
2430 #line 576 "../../src/parser.yy"
2431
2432