2 /* A Bison parser, made by GNU Bison 2.4.1. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
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.
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.
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/>. */
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.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
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. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4.1"
52 #define YYSKELETON_NAME "yacc.c"
63 /* Using locations. */
64 #define YYLSP_NEEDED 1
68 /* Copy the first part of user declarations. */
70 /* Line 189 of yacc.c */
71 #line 22 "../../src/parser.yy"
83 #include "my_sstream.h"
85 #include "acceptedvalues.h"
89 #include "gengetopt.h"
90 #include "errorcodes.h"
94 extern int gengetopt_count_line;
95 extern char * gengetopt_input_filename;
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;
103 /// the last option parsed
104 static gengetopt_option *current_option = 0;
106 extern int yylex (void) ;
108 //#define YYERROR_VERBOSE 1
110 void check_result(int o, gengetopt_option *opt)
118 case NOT_ENOUGH_MEMORY:
119 yyerror (opt, "not enough memory");
121 case REQ_LONG_OPTION:
122 err << "long option redefined \'" << opt->long_opt << "\'";
123 yyerror (opt, err.str().c_str());
125 case REQ_SHORT_OPTION:
126 err << "short option redefined \'" << opt->short_opt << "\'";
127 yyerror (opt, err.str().c_str());
130 yyerror (opt, "bug found!!");
132 case GROUP_UNDEFINED:
133 yyerror (opt, "group undefined");
136 yyerror (opt, "mode undefined");
138 case INVALID_DEFAULT_VALUE:
139 yyerror (opt, "invalid default value");
141 case NOT_REQUESTED_TYPE:
142 yyerror (opt, "type specification not requested");
144 case NOT_VALID_SPECIFICATION:
145 yyerror (opt, "invalid specification for this kind of option");
147 case SPECIFY_FLAG_STAT:
148 yyerror (opt, "you must specify the default flag status");
150 case NOT_GROUP_OPTION:
151 yyerror (opt, "group specification for a non group option");
153 case NOT_MODE_OPTION:
154 yyerror (opt, "mode specification for an option not belonging to a mode");
157 yyerror (opt, "missing group specification");
160 yyerror (opt, "missing mode specification");
162 case INVALID_NUMERIC_VALUE:
163 yyerror (opt, "invalid numeric value");
165 case INVALID_ENUM_TYPE_USE:
166 yyerror (opt, "enum type can only be specified for options with values");
169 yyerror (opt, "if you want to redefine --help, please use option --no-help");
171 case VERSION_REDEFINED:
172 yyerror (opt, "if you want to redefine --version, please use option --no-version");
178 /* the number of allowed occurrences of a multiple option */
181 /* these strings are allocated dynamically and NOT
182 automatically freed upon destruction */
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))
194 #define check_error if (o) YYERROR;
198 /* Line 189 of yacc.c */
199 #line 200 "../../src/parser.cc"
201 /* Enabling traces. */
206 /* Enabling verbose error messages. */
207 #ifdef YYERROR_VERBOSE
208 # undef YYERROR_VERBOSE
209 # define YYERROR_VERBOSE 1
211 # define YYERROR_VERBOSE 0
214 /* Enabling the token table. */
215 #ifndef YYTOKEN_TABLE
216 # define YYTOKEN_TABLE 0
223 /* Put the tokens into the symbol table, so that GDB and other debuggers
230 TOK_GROUPOPTION = 262,
232 TOK_MODEOPTION = 264,
239 TOK_DESCRIPTION = 271,
247 TOK_ARGOPTIONAL = 279,
251 TOK_SECTIONDESC = 283,
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
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
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
292 #define TOK_VALUES 286
293 #define TOK_HIDDEN 287
294 #define TOK_DEPENDON 288
295 #define TOK_STRING 289
297 #define TOK_ARGTYPE 291
303 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
304 typedef union YYSTYPE
307 /* Line 214 of yacc.c */
308 #line 148 "../../src/parser.yy"
314 class AcceptedValues *ValueList;
315 struct gengetopt_option *gengetopt_option;
316 struct multiple_size *multiple_size;
320 /* Line 214 of yacc.c */
321 #line 322 "../../src/parser.cc"
323 # define YYSTYPE_IS_TRIVIAL 1
324 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
325 # define YYSTYPE_IS_DECLARED 1
328 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
329 typedef struct YYLTYPE
336 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
337 # define YYLTYPE_IS_DECLARED 1
338 # define YYLTYPE_IS_TRIVIAL 1
342 /* Copy the second part of user declarations. */
345 /* Line 264 of yacc.c */
346 #line 347 "../../src/parser.cc"
353 typedef YYTYPE_UINT8 yytype_uint8;
355 typedef unsigned char yytype_uint8;
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;
364 typedef short int yytype_int8;
368 typedef YYTYPE_UINT16 yytype_uint16;
370 typedef unsigned short int yytype_uint16;
374 typedef YYTYPE_INT16 yytype_int16;
376 typedef short int yytype_int16;
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
389 # define YYSIZE_T unsigned int
393 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
398 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
399 # define YY_(msgid) dgettext ("bison-runtime", msgid)
403 # define YY_(msgid) msgid
407 /* Suppress unused-variable warnings by "using" E. */
408 #if ! defined lint || defined __GNUC__
409 # define YYUSE(e) ((void) (e))
411 # define YYUSE(e) /* empty */
414 /* Identity function, used to suppress warnings about constant conditions. */
418 #if (defined __STDC__ || defined __C99__FUNC__ \
419 || defined __cplusplus || defined _MSC_VER)
432 #if ! defined yyoverflow || YYERROR_VERBOSE
434 /* The parser invokes alloca or malloc; define the necessary symbols. */
436 # ifdef YYSTACK_USE_ALLOCA
437 # if YYSTACK_USE_ALLOCA
439 # define YYSTACK_ALLOC __builtin_alloca
440 # elif defined __BUILTIN_VA_ARG_INCR
441 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
443 # define YYSTACK_ALLOC __alloca
444 # elif defined _MSC_VER
445 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
446 # define alloca _alloca
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 */
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 */
471 # define YYSTACK_ALLOC YYMALLOC
472 # define YYSTACK_FREE YYFREE
473 # ifndef YYSTACK_ALLOC_MAXIMUM
474 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
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 */
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 */
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 */
499 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
502 #if (! defined yyoverflow \
503 && (! defined __cplusplus \
504 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
505 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
507 /* A type that is properly aligned for any stack member. */
510 yytype_int16 yyss_alloc;
515 /* The size of the maximum gap between one aligned stack and the next. */
516 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
518 /* The size of an array large to enough to hold all stacks, each with
520 # define YYSTACK_BYTES(N) \
521 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
522 + 2 * YYSTACK_GAP_MAXIMUM)
524 /* Copy COUNT objects from FROM to TO. The source and destination do
527 # if defined __GNUC__ && 1 < __GNUC__
528 # define YYCOPY(To, From, Count) \
529 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
531 # define YYCOPY(To, From, Count) \
535 for (yyi = 0; yyi < (Count); yyi++) \
536 (To)[yyi] = (From)[yyi]; \
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
547 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
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); \
560 /* YYFINAL -- State number of the termination state. */
562 /* YYLAST -- Last index in YYTABLE. */
565 /* YYNTOKENS -- Number of terminals. */
567 /* YYNNTS -- Number of nonterminals. */
569 /* YYNRULES -- Number of rules. */
571 /* YYNRULES -- Number of states. */
572 #define YYNSTATES 116
574 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
576 #define YYMAXUTOK 292
578 #define YYTRANSLATE(YYX) \
579 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
581 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
582 static const yytype_uint8 yytranslate[] =
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,
617 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
619 static const yytype_uint8 yyprhs[] =
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
630 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
631 static const yytype_int8 yyrhs[] =
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,
656 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
657 static const yytype_uint16 yyrline[] =
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
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[] =
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
692 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
694 static const yytype_uint16 yytoknum[] =
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,
704 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
705 static const yytype_uint8 yyr1[] =
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
716 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
717 static const yytype_uint8 yyr2[] =
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,
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[] =
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,
747 /* YYDEFGOTO[NTERM-NUM]. */
748 static const yytype_int8 yydefgoto[] =
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
755 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
757 #define YYPACT_NINF -40
758 static const yytype_int8 yypact[] =
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
774 /* YYPGOTO[NTERM-NUM]. */
775 static const yytype_int8 yypgoto[] =
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
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[] =
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,
801 static const yytype_int8 yycheck[] =
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,
815 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
816 symbol of state STATE-NUM. */
817 static const yytype_uint8 yystos[] =
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
833 #define yyerrok (yyerrstatus = 0)
834 #define yyclearin (yychar = YYEMPTY)
838 #define YYACCEPT goto yyacceptlab
839 #define YYABORT goto yyabortlab
840 #define YYERROR goto yyerrorlab
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. */
847 #define YYFAIL goto yyerrlab
849 #define YYRECOVERING() (!!yyerrstatus)
851 #define YYBACKUP(Token, Value) \
853 if (yychar == YYEMPTY && yylen == 1) \
857 yytoken = YYTRANSLATE (yychar); \
863 yyerror (YY_("syntax error: cannot back up")); \
870 #define YYERRCODE 256
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). */
877 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
878 #ifndef YYLLOC_DEFAULT
879 # define YYLLOC_DEFAULT(Current, Rhs, N) \
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; \
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; \
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. */
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)
910 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
915 /* YYLEX -- calling `yylex' with the right arguments. */
918 # define YYLEX yylex (YYLEX_PARAM)
920 # define YYLEX yylex ()
923 /* Enable debugging if requested. */
927 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
928 # define YYFPRINTF fprintf
931 # define YYDPRINTF(Args) \
937 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
941 YYFPRINTF (stderr, "%s ", Title); \
942 yy_symbol_print (stderr, \
943 Type, Value, Location); \
944 YYFPRINTF (stderr, "\n"); \
949 /*--------------------------------.
950 | Print this symbol on YYOUTPUT. |
951 `--------------------------------*/
954 #if (defined __STDC__ || defined __C99__FUNC__ \
955 || defined __cplusplus || defined _MSC_VER)
957 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
960 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
963 YYSTYPE const * const yyvaluep;
964 YYLTYPE const * const yylocationp;
971 if (yytype < YYNTOKENS)
972 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
984 /*--------------------------------.
985 | Print this symbol on YYOUTPUT. |
986 `--------------------------------*/
988 #if (defined __STDC__ || defined __C99__FUNC__ \
989 || defined __cplusplus || defined _MSC_VER)
991 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
994 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
997 YYSTYPE const * const yyvaluep;
998 YYLTYPE const * const yylocationp;
1001 if (yytype < YYNTOKENS)
1002 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1004 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1006 YY_LOCATION_PRINT (yyoutput, *yylocationp);
1007 YYFPRINTF (yyoutput, ": ");
1008 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
1009 YYFPRINTF (yyoutput, ")");
1012 /*------------------------------------------------------------------.
1013 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1015 `------------------------------------------------------------------*/
1017 #if (defined __STDC__ || defined __C99__FUNC__ \
1018 || defined __cplusplus || defined _MSC_VER)
1020 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1023 yy_stack_print (yybottom, yytop)
1024 yytype_int16 *yybottom;
1025 yytype_int16 *yytop;
1028 YYFPRINTF (stderr, "Stack now");
1029 for (; yybottom <= yytop; yybottom++)
1031 int yybot = *yybottom;
1032 YYFPRINTF (stderr, " %d", yybot);
1034 YYFPRINTF (stderr, "\n");
1037 # define YY_STACK_PRINT(Bottom, Top) \
1040 yy_stack_print ((Bottom), (Top)); \
1044 /*------------------------------------------------.
1045 | Report that the YYRULE is going to be reduced. |
1046 `------------------------------------------------*/
1048 #if (defined __STDC__ || defined __C99__FUNC__ \
1049 || defined __cplusplus || defined _MSC_VER)
1051 yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
1054 yy_reduce_print (yyvsp, yylsp, yyrule)
1060 int yynrhs = yyr2[yyrule];
1062 unsigned long int yylno = yyrline[yyrule];
1063 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1065 /* The symbols being reduced. */
1066 for (yyi = 0; yyi < yynrhs; yyi++)
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");
1076 # define YY_REDUCE_PRINT(Rule) \
1079 yy_reduce_print (yyvsp, yylsp, Rule); \
1082 /* Nonzero means print parse trace. It is left uninitialized so that
1083 multiple parsers can coexist. */
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 */
1093 /* YYINITDEPTH -- initial size of the parser's stacks. */
1095 # define YYINITDEPTH 200
1098 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1099 if the built-in stack extension method is used).
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. */
1106 # define YYMAXDEPTH 10000
1114 # if defined __GLIBC__ && defined _STRING_H
1115 # define yystrlen strlen
1117 /* Return the length of YYSTR. */
1118 #if (defined __STDC__ || defined __C99__FUNC__ \
1119 || defined __cplusplus || defined _MSC_VER)
1121 yystrlen (const char *yystr)
1129 for (yylen = 0; yystr[yylen]; yylen++)
1137 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1138 # define yystpcpy stpcpy
1140 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1142 #if (defined __STDC__ || defined __C99__FUNC__ \
1143 || defined __cplusplus || defined _MSC_VER)
1145 yystpcpy (char *yydest, const char *yysrc)
1148 yystpcpy (yydest, yysrc)
1154 const char *yys = yysrc;
1156 while ((*yyd++ = *yys++) != '\0')
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
1173 yytnamerr (char *yyres, const char *yystr)
1178 char const *yyp = yystr;
1185 goto do_not_strip_quotes;
1189 goto do_not_strip_quotes;
1202 do_not_strip_quotes: ;
1206 return yystrlen (yystr);
1208 return yystpcpy (yyres, yystr) - yyres;
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. */
1220 yysyntax_error (char *yyresult, int yystate, int yychar)
1222 int yyn = yypact[yystate];
1224 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1228 int yytype = YYTRANSLATE (yychar);
1229 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1230 YYSIZE_T yysize = yysize0;
1232 int yysize_overflow = 0;
1233 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1234 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
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");
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;
1257 /* Start YYX at -YYN if negative to avoid negative indexes in
1259 int yyxbegin = yyn < 0 ? -yyn : 0;
1261 /* Stay within bounds of both yycheck and yytname. */
1262 int yychecklim = YYLAST - yyn + 1;
1263 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1266 yyarg[0] = yytname[yytype];
1267 yyfmt = yystpcpy (yyformat, yyunexpected);
1269 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1270 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1272 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1276 yyformat[sizeof yyunexpected - 1] = '\0';
1279 yyarg[yycount++] = yytname[yyx];
1280 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1281 yysize_overflow |= (yysize1 < yysize);
1283 yyfmt = yystpcpy (yyfmt, yyprefix);
1287 yyf = YY_(yyformat);
1288 yysize1 = yysize + yystrlen (yyf);
1289 yysize_overflow |= (yysize1 < yysize);
1292 if (yysize_overflow)
1293 return YYSIZE_MAXIMUM;
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;
1302 while ((*yyp = *yyf) != '\0')
1304 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1306 yyp += yytnamerr (yyp, yyarg[yyi++]);
1319 #endif /* YYERROR_VERBOSE */
1322 /*-----------------------------------------------.
1323 | Release the memory associated to this symbol. |
1324 `-----------------------------------------------*/
1327 #if (defined __STDC__ || defined __C99__FUNC__ \
1328 || defined __cplusplus || defined _MSC_VER)
1330 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
1333 yydestruct (yymsg, yytype, yyvaluep, yylocationp)
1337 YYLTYPE *yylocationp;
1341 YYUSE (yylocationp);
1345 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1355 /* Prevent warnings from -Wmissing-prototypes. */
1356 #ifdef YYPARSE_PARAM
1357 #if defined __STDC__ || defined __cplusplus
1358 int yyparse (void *YYPARSE_PARAM);
1362 #else /* ! YYPARSE_PARAM */
1363 #if defined __STDC__ || defined __cplusplus
1368 #endif /* ! YYPARSE_PARAM */
1371 /* The lookahead symbol. */
1374 /* The semantic value of the lookahead symbol. */
1377 /* Location data for the lookahead symbol. */
1380 /* Number of syntax errors so far. */
1385 /*-------------------------.
1386 | yyparse or yypush_parse. |
1387 `-------------------------*/
1389 #ifdef YYPARSE_PARAM
1390 #if (defined __STDC__ || defined __C99__FUNC__ \
1391 || defined __cplusplus || defined _MSC_VER)
1393 yyparse (void *YYPARSE_PARAM)
1396 yyparse (YYPARSE_PARAM)
1397 void *YYPARSE_PARAM;
1399 #else /* ! YYPARSE_PARAM */
1400 #if (defined __STDC__ || defined __C99__FUNC__ \
1401 || defined __cplusplus || defined _MSC_VER)
1414 /* Number of tokens to shift before error messages enabled. */
1417 /* The stacks and their tools:
1418 `yyss': related to states.
1419 `yyvs': related to semantic values.
1420 `yyls': related to locations.
1422 Refer to the stacks thru separate pointers, to allow yyoverflow
1423 to reallocate them elsewhere. */
1425 /* The state stack. */
1426 yytype_int16 yyssa[YYINITDEPTH];
1428 yytype_int16 *yyssp;
1430 /* The semantic value stack. */
1431 YYSTYPE yyvsa[YYINITDEPTH];
1435 /* The location stack. */
1436 YYLTYPE yylsa[YYINITDEPTH];
1440 /* The locations where the error started and ended. */
1441 YYLTYPE yyerror_range[2];
1443 YYSIZE_T yystacksize;
1447 /* Lookahead token as an internal (translated) token number. */
1449 /* The variables used to return semantic value and location from the
1455 /* Buffer for error messages, and its allocated size. */
1457 char *yymsg = yymsgbuf;
1458 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1461 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1463 /* The number of symbols on the RHS of the reduced rule.
1464 Keep to zero when no symbol should be popped. */
1471 yystacksize = YYINITDEPTH;
1473 YYDPRINTF ((stderr, "Starting parse\n"));
1478 yychar = YYEMPTY; /* Cause a token to be read. */
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. */
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;
1496 /*------------------------------------------------------------.
1497 | yynewstate -- Push a new state, which is found in yystate. |
1498 `------------------------------------------------------------*/
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. */
1507 if (yyss + yystacksize - 1 <= yyssp)
1509 /* Get the current used size of the three stacks, in elements. */
1510 YYSIZE_T yysize = yyssp - yyss + 1;
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
1517 YYSTYPE *yyvs1 = yyvs;
1518 yytype_int16 *yyss1 = yyss;
1519 YYLTYPE *yyls1 = yyls;
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),
1535 #else /* no yyoverflow */
1536 # ifndef YYSTACK_RELOCATE
1537 goto yyexhaustedlab;
1539 /* Extend the stack our own way. */
1540 if (YYMAXDEPTH <= yystacksize)
1541 goto yyexhaustedlab;
1543 if (YYMAXDEPTH < yystacksize)
1544 yystacksize = YYMAXDEPTH;
1547 yytype_int16 *yyss1 = yyss;
1548 union yyalloc *yyptr =
1549 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
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
1557 YYSTACK_FREE (yyss1);
1560 #endif /* no yyoverflow */
1562 yyssp = yyss + yysize - 1;
1563 yyvsp = yyvs + yysize - 1;
1564 yylsp = yyls + yysize - 1;
1566 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1567 (unsigned long int) yystacksize));
1569 if (yyss + yystacksize - 1 <= yyssp)
1573 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1575 if (yystate == YYFINAL)
1585 /* Do appropriate processing given the current state. Read a
1586 lookahead token if we need one and don't already have one. */
1588 /* First try to decide what to do without reference to lookahead token. */
1589 yyn = yypact[yystate];
1590 if (yyn == YYPACT_NINF)
1593 /* Not known => get a lookahead token if don't already have one. */
1595 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1596 if (yychar == YYEMPTY)
1598 YYDPRINTF ((stderr, "Reading a token: "));
1602 if (yychar <= YYEOF)
1604 yychar = yytoken = YYEOF;
1605 YYDPRINTF ((stderr, "Now at end of input.\n"));
1609 yytoken = YYTRANSLATE (yychar);
1610 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1613 /* If the proper action on seeing token YYTOKEN is to reduce or to
1614 detect an error, take that action. */
1616 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1621 if (yyn == 0 || yyn == YYTABLE_NINF)
1627 /* Count tokens shifted since error; after three, turn off error
1632 /* Shift the lookahead token. */
1633 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1635 /* Discard the shifted token. */
1644 /*-----------------------------------------------------------.
1645 | yydefault -- do the default action for the current state. |
1646 `-----------------------------------------------------------*/
1648 yyn = yydefact[yystate];
1654 /*-----------------------------.
1655 | yyreduce -- Do a reduction. |
1656 `-----------------------------*/
1658 /* yyn is the number of a rule to reduce with. */
1661 /* If YYLEN is nonzero, implement the default value of the action:
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];
1671 /* Default location. */
1672 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1673 YY_REDUCE_PRINT (yyn);
1678 /* Line 1455 of yacc.c */
1679 #line 234 "../../src/parser.yy"
1681 if (gengetopt_package_given)
1683 yyerror ("package redefined");
1688 gengetopt_package_given = 1;
1689 if (gengetopt_define_package ((yyvsp[(2) - (2)].str)))
1691 yyerror ("not enough memory");
1700 /* Line 1455 of yacc.c */
1701 #line 254 "../../src/parser.yy"
1703 if (gengetopt_version_given)
1705 yyerror ("version redefined");
1710 gengetopt_version_given = 1;
1711 if (gengetopt_define_version ((yyvsp[(2) - (2)].str)))
1713 yyerror ("not enough memory");
1722 /* Line 1455 of yacc.c */
1723 #line 274 "../../src/parser.yy"
1725 if (gengetopt_purpose_given)
1727 yyerror ("purpose redefined");
1732 gengetopt_purpose_given = 1;
1733 if (gengetopt_define_purpose ((yyvsp[(2) - (2)].str)))
1735 yyerror ("not enough memory");
1744 /* Line 1455 of yacc.c */
1745 #line 294 "../../src/parser.yy"
1747 if (gengetopt_description_given)
1749 yyerror ("description redefined");
1754 gengetopt_description_given = 1;
1755 if (gengetopt_define_description ((yyvsp[(2) - (2)].str)))
1757 yyerror ("not enough memory");
1766 /* Line 1455 of yacc.c */
1767 #line 314 "../../src/parser.yy"
1769 if (gengetopt_usage_given)
1771 yyerror ("usage redefined");
1776 gengetopt_usage_given = 1;
1777 if (gengetopt_define_usage ((yyvsp[(2) - (2)].str)))
1779 yyerror ("not enough memory");
1788 /* Line 1455 of yacc.c */
1789 #line 335 "../../src/parser.yy"
1791 gengetopt_set_section ((yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str));
1797 /* Line 1455 of yacc.c */
1798 #line 342 "../../src/parser.yy"
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());
1806 current_option->text_after = strdup((yyvsp[(2) - (2)].str));
1809 gengetopt_set_text((yyvsp[(2) - (2)].str));
1816 /* Line 1455 of yacc.c */
1817 #line 359 "../../src/parser.yy"
1819 gengetopt_set_args((yyvsp[(2) - (2)].str));
1825 /* Line 1455 of yacc.c */
1826 #line 366 "../../src/parser.yy"
1828 if (gengetopt_add_group ((yyvsp[(2) - (4)].str), (yyvsp[(3) - (4)].str), (yyvsp[(4) - (4)].boolean)))
1830 yyerror ("group redefined");
1838 /* Line 1455 of yacc.c */
1839 #line 377 "../../src/parser.yy"
1841 if (gengetopt_add_mode ((yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str)))
1843 yyerror ("mode redefined");
1851 /* Line 1455 of yacc.c */
1852 #line 389 "../../src/parser.yy"
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));
1863 o = gengetopt_add_option ((yyvsp[(5) - (5)].gengetopt_option));
1864 check_result(o, (yyvsp[(5) - (5)].gengetopt_option));
1866 current_option = (yyvsp[(5) - (5)].gengetopt_option);
1872 /* Line 1455 of yacc.c */
1873 #line 409 "../../src/parser.yy"
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));
1884 o = gengetopt_add_option ((yyvsp[(5) - (5)].gengetopt_option));
1885 check_result(o, (yyvsp[(5) - (5)].gengetopt_option));
1892 /* Line 1455 of yacc.c */
1893 #line 428 "../../src/parser.yy"
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));
1904 o = gengetopt_add_option ((yyvsp[(5) - (5)].gengetopt_option));
1905 check_result(o, (yyvsp[(5) - (5)].gengetopt_option));
1912 /* Line 1455 of yacc.c */
1913 #line 452 "../../src/parser.yy"
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;
1923 /* Line 1455 of yacc.c */
1924 #line 458 "../../src/parser.yy"
1926 (yyval.gengetopt_option) = (yyvsp[(1) - (2)].gengetopt_option);
1927 (yyval.gengetopt_option)->type = (yyvsp[(2) - (2)].argtype);
1933 /* Line 1455 of yacc.c */
1934 #line 463 "../../src/parser.yy"
1936 (yyval.gengetopt_option) = (yyvsp[(1) - (4)].gengetopt_option);
1937 (yyval.gengetopt_option)->type_str = strdup((yyvsp[(4) - (4)].str));
1943 /* Line 1455 of yacc.c */
1944 #line 468 "../../src/parser.yy"
1946 (yyval.gengetopt_option) = (yyvsp[(1) - (4)].gengetopt_option);
1947 (yyval.gengetopt_option)->details = strdup((yyvsp[(4) - (4)].str));
1953 /* Line 1455 of yacc.c */
1954 #line 473 "../../src/parser.yy"
1956 (yyval.gengetopt_option) = (yyvsp[(1) - (4)].gengetopt_option);
1957 (yyval.gengetopt_option)->acceptedvalues = (yyvsp[(4) - (4)].ValueList);
1963 /* Line 1455 of yacc.c */
1964 #line 478 "../../src/parser.yy"
1966 (yyval.gengetopt_option) = (yyvsp[(1) - (4)].gengetopt_option);
1967 (yyval.gengetopt_option)->default_string = strdup((yyvsp[(4) - (4)].str));
1973 /* Line 1455 of yacc.c */
1974 #line 483 "../../src/parser.yy"
1976 (yyval.gengetopt_option) = (yyvsp[(1) - (4)].gengetopt_option);
1977 (yyval.gengetopt_option)->group_value = strdup((yyvsp[(4) - (4)].str));
1983 /* Line 1455 of yacc.c */
1984 #line 488 "../../src/parser.yy"
1986 (yyval.gengetopt_option) = (yyvsp[(1) - (4)].gengetopt_option);
1987 (yyval.gengetopt_option)->mode_value = strdup((yyvsp[(4) - (4)].str));
1993 /* Line 1455 of yacc.c */
1994 #line 493 "../../src/parser.yy"
1996 (yyval.gengetopt_option) = (yyvsp[(1) - (4)].gengetopt_option);
1997 (yyval.gengetopt_option)->dependon = strdup((yyvsp[(4) - (4)].str));
2003 /* Line 1455 of yacc.c */
2004 #line 498 "../../src/parser.yy"
2006 (yyval.gengetopt_option) = (yyvsp[(1) - (2)].gengetopt_option);
2007 (yyval.gengetopt_option)->arg_is_optional = true;
2013 /* Line 1455 of yacc.c */
2014 #line 503 "../../src/parser.yy"
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);
2026 /* Line 1455 of yacc.c */
2027 #line 511 "../../src/parser.yy"
2029 (yyval.gengetopt_option) = (yyvsp[(1) - (2)].gengetopt_option);
2030 (yyval.gengetopt_option)->type = ARG_FLAG;
2036 /* Line 1455 of yacc.c */
2037 #line 516 "../../src/parser.yy"
2039 (yyval.gengetopt_option) = (yyvsp[(1) - (2)].gengetopt_option);
2040 (yyval.gengetopt_option)->hidden = true;
2046 /* Line 1455 of yacc.c */
2047 #line 521 "../../src/parser.yy"
2049 (yyval.gengetopt_option) = (yyvsp[(1) - (2)].gengetopt_option);
2050 (yyval.gengetopt_option)->flagstat = (yyvsp[(2) - (2)].boolean);
2056 /* Line 1455 of yacc.c */
2057 #line 525 "../../src/parser.yy"
2058 { (yyval.gengetopt_option) = new gengetopt_option; }
2063 /* Line 1455 of yacc.c */
2064 #line 529 "../../src/parser.yy"
2065 { (yyval.boolean) = 1; }
2070 /* Line 1455 of yacc.c */
2071 #line 530 "../../src/parser.yy"
2072 { (yyval.boolean) = 0; }
2077 /* Line 1455 of yacc.c */
2078 #line 534 "../../src/parser.yy"
2079 { (yyval.boolean) = 0; }
2084 /* Line 1455 of yacc.c */
2085 #line 535 "../../src/parser.yy"
2086 { (yyval.boolean) = 1; }
2091 /* Line 1455 of yacc.c */
2092 #line 536 "../../src/parser.yy"
2093 { (yyval.boolean) = 0; }
2098 /* Line 1455 of yacc.c */
2099 #line 540 "../../src/parser.yy"
2100 { (yyval.boolean) = 1; }
2105 /* Line 1455 of yacc.c */
2106 #line 541 "../../src/parser.yy"
2107 { (yyval.boolean) = 0; }
2112 /* Line 1455 of yacc.c */
2113 #line 545 "../../src/parser.yy"
2114 { (yyval.str) = 0; }
2119 /* Line 1455 of yacc.c */
2120 #line 546 "../../src/parser.yy"
2121 { (yyval.str) = (yyvsp[(3) - (3)].str); }
2126 /* Line 1455 of yacc.c */
2127 #line 550 "../../src/parser.yy"
2128 { (yyval.str) = 0; }
2133 /* Line 1455 of yacc.c */
2134 #line 551 "../../src/parser.yy"
2135 { (yyval.str) = (yyvsp[(3) - (3)].str); }
2140 /* Line 1455 of yacc.c */
2141 #line 555 "../../src/parser.yy"
2142 { (yyval.str) = 0; }
2147 /* Line 1455 of yacc.c */
2148 #line 556 "../../src/parser.yy"
2149 { (yyval.str) = (yyvsp[(3) - (3)].str); }
2154 /* Line 1455 of yacc.c */
2155 #line 560 "../../src/parser.yy"
2156 { (yyval.ValueList) = new AcceptedValues; (yyval.ValueList)->insert((yyvsp[(1) - (1)].str)); }
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); }
2168 /* Line 1455 of yacc.c */
2169 #line 565 "../../src/parser.yy"
2170 { (yyval.str) = (yyvsp[(1) - (1)].str); }
2175 /* Line 1455 of yacc.c */
2176 #line 569 "../../src/parser.yy"
2177 { (yyval.multiple_size) = new multiple_size; }
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)); }
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)); }
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)); }
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)); }
2210 /* Line 1455 of yacc.c */
2211 #line 2212 "../../src/parser.cc"
2214 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2218 YY_STACK_PRINT (yyss, yyssp);
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. */
2229 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2230 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2231 yystate = yytable[yystate];
2233 yystate = yydefgoto[yyn - YYNTOKENS];
2238 /*------------------------------------.
2239 | yyerrlab -- here on detecting error |
2240 `------------------------------------*/
2242 /* If not already recovering from an error, report this error. */
2246 #if ! YYERROR_VERBOSE
2247 yyerror (YY_("syntax error"));
2250 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2251 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
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);
2260 yymsg_alloc = yyalloc;
2264 yymsg_alloc = sizeof yymsgbuf;
2268 if (0 < yysize && yysize <= yymsg_alloc)
2270 (void) yysyntax_error (yymsg, yystate, yychar);
2275 yyerror (YY_("syntax error"));
2277 goto yyexhaustedlab;
2283 yyerror_range[0] = yylloc;
2285 if (yyerrstatus == 3)
2287 /* If just tried and failed to reuse lookahead token after an
2288 error, discard it. */
2290 if (yychar <= YYEOF)
2292 /* Return failure if at end of input. */
2293 if (yychar == YYEOF)
2298 yydestruct ("Error: discarding",
2299 yytoken, &yylval, &yylloc);
2304 /* Else will try to reuse lookahead token after shifting the error
2309 /*---------------------------------------------------.
2310 | yyerrorlab -- error raised explicitly by YYERROR. |
2311 `---------------------------------------------------*/
2314 /* Pacify compilers like GCC when the user code never invokes
2315 YYERROR and the label yyerrorlab therefore never appears in user
2317 if (/*CONSTCOND*/ 0)
2320 yyerror_range[0] = yylsp[1-yylen];
2321 /* Do not reclaim the symbols of the rule which action triggered
2325 YY_STACK_PRINT (yyss, yyssp);
2330 /*-------------------------------------------------------------.
2331 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2332 `-------------------------------------------------------------*/
2334 yyerrstatus = 3; /* Each real token shifted decrements this. */
2338 yyn = yypact[yystate];
2339 if (yyn != YYPACT_NINF)
2342 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2350 /* Pop the current state because it cannot handle the error token. */
2354 yyerror_range[0] = *yylsp;
2355 yydestruct ("Error: popping",
2356 yystos[yystate], yyvsp, yylsp);
2359 YY_STACK_PRINT (yyss, yyssp);
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);
2370 /* Shift the error token. */
2371 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2377 /*-------------------------------------.
2378 | yyacceptlab -- YYACCEPT comes here. |
2379 `-------------------------------------*/
2384 /*-----------------------------------.
2385 | yyabortlab -- YYABORT comes here. |
2386 `-----------------------------------*/
2391 #if !defined(yyoverflow) || YYERROR_VERBOSE
2392 /*-------------------------------------------------.
2393 | yyexhaustedlab -- memory exhaustion comes here. |
2394 `-------------------------------------------------*/
2396 yyerror (YY_("memory exhausted"));
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. */
2408 YY_STACK_PRINT (yyss, yyssp);
2409 while (yyssp != yyss)
2411 yydestruct ("Cleanup: popping",
2412 yystos[*yyssp], yyvsp, yylsp);
2417 YYSTACK_FREE (yyss);
2420 if (yymsg != yymsgbuf)
2421 YYSTACK_FREE (yymsg);
2423 /* Make sure YYID is used. */
2424 return YYID (yyresult);
2429 /* Line 1675 of yacc.c */
2430 #line 576 "../../src/parser.yy"