1 /* A Bison parser, made by GNU Bison 3.4.2. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
44 /* Undocumented macros, especially those whose name start with YY_,
45 are private implementation details. Do not rely on them. */
47 /* Identify Bison output. */
51 #define YYBISON_VERSION "3.4.2"
54 #define YYSKELETON_NAME "yacc.c"
68 /* First part of user prologue. */
71 #include "parser.gmrdecl.c"
76 # if defined __cplusplus
77 # if 201103L <= __cplusplus
78 # define YY_NULLPTR nullptr
83 # define YY_NULLPTR ((void*)0)
87 /* Enabling verbose error messages. */
88 #ifdef YYERROR_VERBOSE
89 # undef YYERROR_VERBOSE
90 # define YYERROR_VERBOSE 1
92 # define YYERROR_VERBOSE 0
95 /* Use api.header.include to #include this header
96 instead of duplicating it here. */
97 #ifndef YY_YY_SCRIPTS_KCONFIG_PARSER_TAB_H_INCLUDED
98 # define YY_YY_SCRIPTS_KCONFIG_PARSER_TAB_H_INCLUDED
109 extern YYSTYPE yylval
;
113 #endif /* !YY_YY_SCRIPTS_KCONFIG_PARSER_TAB_H_INCLUDED */
115 /* Include kconf_id.c here so it can see the token constants. */
116 //#include "../kconf_id.c"
117 #include "../token_id.c"
126 typedef YYTYPE_UINT8 yytype_uint8
;
128 typedef unsigned char yytype_uint8
;
132 typedef YYTYPE_INT8 yytype_int8
;
134 typedef signed char yytype_int8
;
138 typedef YYTYPE_UINT16 yytype_uint16
;
140 typedef unsigned short yytype_uint16
;
144 typedef YYTYPE_INT16 yytype_int16
;
146 typedef short yytype_int16
;
150 # ifdef __SIZE_TYPE__
151 # define YYSIZE_T __SIZE_TYPE__
152 # elif defined size_t
153 # define YYSIZE_T size_t
154 # elif ! defined YYSIZE_T
155 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
156 # define YYSIZE_T size_t
158 # define YYSIZE_T unsigned
162 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
165 # if defined YYENABLE_NLS && YYENABLE_NLS
167 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
168 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
172 # define YY_(Msgid) Msgid
177 # if (defined __GNUC__ \
178 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
179 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
180 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
182 # define YY_ATTRIBUTE(Spec) /* empty */
186 #ifndef YY_ATTRIBUTE_PURE
187 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
190 #ifndef YY_ATTRIBUTE_UNUSED
191 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
194 /* Suppress unused-variable warnings by "using" E. */
195 #if ! defined lint || defined __GNUC__
196 # define YYUSE(E) ((void) (E))
198 # define YYUSE(E) /* empty */
201 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
202 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
203 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
204 _Pragma ("GCC diagnostic push") \
205 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
206 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
207 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
208 _Pragma ("GCC diagnostic pop")
210 # define YY_INITIAL_VALUE(Value) Value
212 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
213 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
214 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
216 #ifndef YY_INITIAL_VALUE
217 # define YY_INITIAL_VALUE(Value) /* Nothing. */
221 #define YY_ASSERT(E) ((void) (0 && (E)))
223 #if ! defined yyoverflow || YYERROR_VERBOSE
225 /* The parser invokes alloca or malloc; define the necessary symbols. */
227 # ifdef YYSTACK_USE_ALLOCA
228 # if YYSTACK_USE_ALLOCA
230 # define YYSTACK_ALLOC __builtin_alloca
231 # elif defined __BUILTIN_VA_ARG_INCR
232 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
234 # define YYSTACK_ALLOC __alloca
235 # elif defined _MSC_VER
236 # include <malloglob.h> /* INFRINGES ON USER NAME SPACE */
237 # define alloca _alloca
239 # define YYSTACK_ALLOC alloca
240 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
241 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
242 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
243 # ifndef EXIT_SUCCESS
244 # define EXIT_SUCCESS 0
251 # ifdef YYSTACK_ALLOC
252 /* Pacify GCC's 'empty if-body' warning. */
253 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
254 # ifndef YYSTACK_ALLOC_MAXIMUM
255 /* The OS might guarantee only one guard page at the bottom of the stack,
256 and a page size can be as small as 4096 bytes. So we cannot safely
257 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
258 to allow for a few compiler-allocated temporary stack slots. */
259 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
262 # define YYSTACK_ALLOC YYMALLOC
263 # define YYSTACK_FREE YYFREE
264 # ifndef YYSTACK_ALLOC_MAXIMUM
265 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
267 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
268 && ! ((defined YYMALLOC || defined malloc) \
269 && (defined YYFREE || defined free)))
270 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
271 # ifndef EXIT_SUCCESS
272 # define EXIT_SUCCESS 0
276 # define YYMALLOC malloc
277 # if ! defined malloc && ! defined EXIT_SUCCESS
278 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
283 # if ! defined free && ! defined EXIT_SUCCESS
284 void free (void *); /* INFRINGES ON USER NAME SPACE */
288 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
291 #if (! defined yyoverflow \
292 && (! defined __cplusplus \
293 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
295 /* A type that is properly aligned for any stack member. */
298 yytype_int16 yyss_alloc
;
302 /* The size of the maximum gap between one aligned stack and the next. */
303 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
305 /* The size of an array large to enough to hold all stacks, each with
307 # define YYSTACK_BYTES(N) \
308 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
309 + YYSTACK_GAP_MAXIMUM)
311 # define YYCOPY_NEEDED 1
313 /* Relocate STACK from its old location to the new one. The
314 local variables YYSIZE and YYSTACKSIZE give the old and new number of
315 elements in the stack, and YYPTR gives the new location of the
316 stack. Advance YYPTR to a properly aligned location for the next
318 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
321 YYSIZE_T yynewbytes; \
322 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
323 Stack = &yyptr->Stack_alloc; \
324 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
325 yyptr += yynewbytes / sizeof (*yyptr); \
331 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
332 /* Copy COUNT objects from SRC to DST. The source and destination do
335 # if defined __GNUC__ && 1 < __GNUC__
336 # define YYCOPY(Dst, Src, Count) \
337 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
339 # define YYCOPY(Dst, Src, Count) \
343 for (yyi = 0; yyi < (Count); yyi++) \
344 (Dst)[yyi] = (Src)[yyi]; \
349 #endif /* !YYCOPY_NEEDED */
351 /* YYFINAL -- State number of the termination state. */
353 /* YYLAST -- Last index in YYTABLE. */
356 /* YYNTOKENS -- Number of terminals. */
358 /* YYNNTS -- Number of nonterminals. */
360 /* YYNRULES -- Number of rules. */
362 /* YYNSTATES -- Number of states. */
363 #define YYNSTATES 186
366 #define YYMAXUTOK 307
368 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
369 as returned by yylex, with out-of-bounds checking. */
370 #define YYTRANSLATE(YYX) \
371 ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
373 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
374 as returned by yylex. */
375 static const yytype_uint8 yytranslate
[] =
377 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
378 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
379 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
380 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
381 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
382 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
383 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
384 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
385 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
386 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
387 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
390 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
395 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
398 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
399 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
400 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
401 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
402 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
403 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
404 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
405 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
406 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
407 45, 46, 47, 48, 49, 50, 51, 52
411 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
412 static const yytype_uint16 yyrline
[] =
414 0, 112, 112, 112, 116, 121, 123, 124, 125, 126,
415 127, 131, 132, 133, 134, 135, 136, 141, 148, 153,
416 160, 169, 171, 172, 173, 176, 184, 190, 200, 206,
417 212, 218, 223, 228, 235, 245, 250, 258, 261, 263,
418 264, 265, 268, 274, 281, 287, 295, 296, 297, 298,
419 301, 302, 305, 306, 307, 309, 311, 316, 324, 332,
420 337, 344, 349, 357, 360, 362, 363, 366, 375, 382,
421 385, 387, 392, 398, 416, 423, 430, 432, 437, 438,
422 441, 442, 443, 446, 447, 450, 451, 452, 453, 454,
423 455, 456, 457, 458, 459, 460, 464, 466, 467, 470,
424 471, 475, 478, 479, 480, 484, 485
428 #if YYDEBUG || YYERROR_VERBOSE || 0
429 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
430 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
431 static const char *const yytname
[] =
433 "$end", "error", "$undefined", "T_HELPTEXT", "T_WORD", "T_WORD_QUOTE",
434 "T_ALLNOCONFIG_Y", "T_BOOL", "T_CHOICE", "T_CLOSE_PAREN",
435 "T_COLON_EQUAL", "T_COMMENT", "T_CONFIG", "T_DEFAULT",
436 "T_DEFCONFIG_LIST", "T_DEF_BOOL", "T_DEF_TRISTATE", "T_DEPENDS",
437 "T_ENDCHOICE", "T_ENDIF", "T_ENDMENU", "T_HELP", "T_HEX", "T_IF",
438 "T_IMPLY", "T_INT", "T_MAINMENU", "T_MENU", "T_MENUCONFIG", "T_MODULES",
439 "T_ON", "T_OPEN_PAREN", "T_OPTION", "T_OPTIONAL", "T_PLUS_EQUAL",
440 "T_PROMPT", "T_RANGE", "T_SELECT", "T_SOURCE", "T_STRING", "T_TRISTATE",
441 "T_VISIBLE", "T_EOL", "T_ASSIGN_VAL", "T_OR", "T_AND", "T_EQUAL",
442 "T_UNEQUAL", "T_LESS", "T_LESS_EQUAL", "T_GREATER", "T_GREATER_EQUAL",
443 "T_NOT", "$accept", "input", "mainmenu_stmt", "stmt_list", "common_stmt",
444 "config_entry_start", "config_stmt", "menuconfig_entry_start",
445 "menuconfig_stmt", "config_option_list", "config_option", "choice",
446 "choice_entry", "choice_end", "choice_stmt", "choice_option_list",
447 "choice_option", "type", "logic_type", "default", "choice_block",
448 "if_entry", "if_end", "if_stmt", "menu", "menu_entry", "menu_end",
449 "menu_stmt", "menu_option_list", "source_stmt", "comment",
450 "comment_stmt", "comment_option_list", "help_start", "help", "depends",
451 "visible", "prompt_stmt_opt", "prompt", "end", "if_expr", "expr",
452 "nonconst_symbol", "symbol", "word_opt", "assignment_stmt", "assign_op",
453 "assign_val", YY_NULLPTR
458 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
459 (internal) symbol number NUM (which must be that of a token). */
460 static const yytype_uint16 yytoknum
[] =
462 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
463 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
464 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
465 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
466 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
471 #define YYPACT_NINF -70
473 #define yypact_value_is_default(Yystate) \
474 (!!((Yystate) == (-70)))
476 #define YYTABLE_NINF -4
478 #define yytable_value_is_error(Yytable_value) \
481 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
483 static const yytype_int16 yypact
[] =
485 -3, 12, 43, -70, 30, -70, -70, 23, -70, 55,
486 27, 18, 40, 12, 68, 9, 12, 68, 12, -70,
487 -70, -70, -70, -70, -70, -70, -70, -70, -70, -70,
488 -70, -70, -70, -70, -70, -70, -70, -70, 32, -70,
489 -70, -70, 36, -70, 44, 45, -70, 47, -70, 9,
490 9, 31, -70, 119, 52, 54, 60, 110, 110, 123,
491 101, 80, 4, 80, 92, -70, -70, 72, -70, -70,
492 -70, 26, -70, -70, 9, 9, 28, 28, 28, 28,
493 28, 28, -70, -70, -70, -70, -70, -70, -70, 85,
494 74, -70, 68, -70, 33, 12, 28, 68, -70, -70,
495 -70, 12, -70, 9, 125, -70, -70, 68, 91, 12,
496 -70, 12, -70, -70, 14, 95, 96, 99, -70, -70,
497 -70, -70, -70, 120, -70, -70, -70, -70, -70, -70,
498 -70, 77, -70, -70, -70, -70, -70, -70, -70, 9,
499 -70, 120, 106, 111, 112, 120, 28, 120, 130, 120,
500 6, -70, 120, -70, 120, 133, -70, -70, -70, 9,
501 134, 129, 136, -70, -70, -70, 137, 120, 138, -70,
502 -70, 139, 140, 141, -70, -8, -70, -70, -70, -70,
503 142, -70, -70, -70, -70, -70
506 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
507 Performed when YYTABLE does not specify something else to do. Zero
508 means the default is an error. */
509 static const yytype_uint8 yydefact
[] =
511 5, 0, 0, 5, 0, 78, 79, 0, 1, 0,
512 0, 0, 99, 0, 0, 0, 0, 0, 0, 6,
513 21, 13, 21, 14, 38, 55, 7, 5, 11, 64,
514 5, 8, 15, 70, 12, 16, 4, 10, 0, 103,
515 104, 102, 105, 100, 0, 0, 96, 0, 98, 0,
516 0, 0, 97, 85, 0, 0, 0, 18, 20, 35,
517 0, 0, 61, 0, 69, 9, 106, 0, 34, 68,
518 17, 0, 93, 57, 0, 0, 0, 0, 0, 0,
519 0, 0, 60, 19, 67, 50, 52, 53, 54, 0,
520 0, 48, 0, 47, 0, 0, 0, 0, 49, 51,
521 22, 76, 46, 0, 0, 24, 23, 0, 0, 0,
522 39, 76, 41, 40, 0, 0, 0, 0, 56, 37,
523 36, 59, 58, 83, 66, 65, 63, 62, 71, 101,
524 92, 94, 95, 90, 91, 86, 87, 88, 89, 0,
525 72, 83, 0, 0, 0, 83, 0, 83, 0, 83,
526 83, 73, 83, 44, 83, 0, 81, 82, 80, 0,
527 0, 0, 0, 33, 32, 31, 0, 83, 0, 25,
528 77, 0, 0, 0, 43, 84, 75, 74, 29, 26,
529 0, 28, 27, 45, 42, 30
532 /* YYPGOTO[NTERM-NUM]. */
533 static const yytype_int16 yypgoto
[] =
535 -70, -70, -70, 19, 126, -70, -70, -70, -70, 163,
536 -70, -70, -70, -70, -70, -70, -70, -70, 93, -70,
537 -70, -70, -70, -70, -70, -70, -70, -70, -70, -70,
538 -70, -70, -70, -70, 102, 42, -70, 76, 2, -57,
539 10, -49, -12, -69, -70, -70, -70, -70
542 /* YYDEFGOTO[NTERM-NUM]. */
543 static const yytype_int16 yydefgoto
[] =
545 -1, 2, 3, 4, 19, 20, 21, 22, 23, 57,
546 100, 24, 25, 119, 26, 59, 110, 101, 102, 103,
547 60, 27, 121, 28, 29, 30, 126, 31, 62, 32,
548 33, 34, 64, 104, 105, 106, 125, 148, 149, 120,
549 160, 51, 52, 53, 44, 35, 42, 67
552 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
553 positive, shift that token. If negative, reduce the rule whose
554 number is the opposite. If YYTABLE_NINF, syntax error. */
555 static const yytype_int16 yytable
[] =
557 71, 72, 47, 7, 122, 55, 127, 133, 134, 135,
558 136, 137, 138, 46, 48, 45, 5, 6, 54, 38,
559 56, 89, 9, 1, 39, 131, 132, 146, 39, 159,
560 -3, 10, 46, 48, 11, 130, 74, 75, 12, 142,
561 49, 13, 14, 8, 43, 123, 61, 143, 40, 63,
562 74, 75, 40, 15, 150, -2, 10, 16, 17, 11,
563 41, 50, 144, 12, 41, 36, 13, 14, 18, 37,
564 74, 75, 46, 73, 65, 74, 75, 167, 15, 66,
565 141, 10, 16, 17, 11, 147, 68, 69, 12, 70,
566 161, 13, 14, 18, 82, 152, 83, 145, 115, 116,
567 117, 113, 84, 15, 124, 114, 128, 16, 17, 89,
568 175, 154, 13, 14, 129, 139, 140, 85, 18, 115,
569 116, 117, 75, 86, 15, 87, 88, 89, 151, 17,
570 85, 90, 91, 153, 92, 93, 107, 156, 157, 18,
571 89, 158, 94, 159, 90, 95, 96, 97, 163, 98,
572 99, 162, 111, 164, 165, 166, 108, 168, 109, 170,
573 171, 112, 172, 99, 173, 76, 77, 78, 79, 80,
574 81, 177, 169, 74, 75, 174, 176, 180, 178, 179,
575 181, 182, 183, 184, 185, 58, 118, 155
578 static const yytype_uint8 yycheck
[] =
580 49, 50, 14, 1, 61, 17, 63, 76, 77, 78,
581 79, 80, 81, 4, 5, 13, 4, 5, 16, 1,
582 18, 17, 3, 26, 10, 74, 75, 96, 10, 23,
583 0, 1, 4, 5, 4, 9, 44, 45, 8, 6,
584 31, 11, 12, 0, 4, 41, 27, 14, 34, 30,
585 44, 45, 34, 23, 103, 0, 1, 27, 28, 4,
586 46, 52, 29, 8, 46, 42, 11, 12, 38, 42,
587 44, 45, 4, 42, 42, 44, 45, 146, 23, 43,
588 92, 1, 27, 28, 4, 97, 42, 42, 8, 42,
589 139, 11, 12, 38, 42, 107, 42, 95, 18, 19,
590 20, 59, 42, 23, 62, 4, 64, 27, 28, 17,
591 159, 109, 11, 12, 42, 30, 42, 7, 38, 18,
592 19, 20, 45, 13, 23, 15, 16, 17, 3, 28,
593 7, 21, 22, 42, 24, 25, 13, 42, 42, 38,
594 17, 42, 32, 23, 21, 35, 36, 37, 42, 39,
595 40, 141, 59, 42, 42, 145, 33, 147, 35, 149,
596 150, 59, 152, 40, 154, 46, 47, 48, 49, 50,
597 51, 42, 42, 44, 45, 42, 42, 167, 42, 42,
598 42, 42, 42, 42, 42, 22, 60, 111
601 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
602 symbol of state STATE-NUM. */
603 static const yytype_uint8 yystos
[] =
605 0, 26, 54, 55, 56, 4, 5, 91, 0, 56,
606 1, 4, 8, 11, 12, 23, 27, 28, 38, 57,
607 58, 59, 60, 61, 64, 65, 67, 74, 76, 77,
608 78, 80, 82, 83, 84, 98, 42, 42, 1, 10,
609 34, 46, 99, 4, 97, 91, 4, 95, 5, 31,
610 52, 94, 95, 96, 91, 95, 91, 62, 62, 68,
611 73, 56, 81, 56, 85, 42, 43, 100, 42, 42,
612 42, 94, 94, 42, 44, 45, 46, 47, 48, 49,
613 50, 51, 42, 42, 42, 7, 13, 15, 16, 17,
614 21, 22, 24, 25, 32, 35, 36, 37, 39, 40,
615 63, 70, 71, 72, 86, 87, 88, 13, 33, 35,
616 69, 71, 87, 88, 4, 18, 19, 20, 57, 66,
617 92, 75, 92, 41, 88, 89, 79, 92, 88, 42,
618 9, 94, 94, 96, 96, 96, 96, 96, 96, 30,
619 42, 95, 6, 14, 29, 91, 96, 95, 90, 91,
620 94, 3, 95, 42, 91, 90, 42, 42, 42, 23,
621 93, 94, 93, 42, 42, 42, 93, 96, 93, 42,
622 93, 93, 93, 93, 42, 94, 42, 42, 42, 42,
623 93, 42, 42, 42, 42, 42
626 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
627 static const yytype_uint8 yyr1
[] =
629 0, 53, 54, 54, 55, 56, 56, 56, 56, 56,
630 56, 57, 57, 57, 57, 57, 57, 58, 59, 60,
631 61, 62, 62, 62, 62, 63, 63, 63, 63, 63,
632 63, 63, 63, 63, 64, 65, 66, 67, 68, 68,
633 68, 68, 69, 69, 69, 69, 70, 70, 70, 70,
634 71, 71, 72, 72, 72, 73, 73, 74, 75, 76,
635 77, 78, 79, 80, 81, 81, 81, 82, 83, 84,
636 85, 85, 86, 87, 88, 89, 90, 90, 91, 91,
637 92, 92, 92, 93, 93, 94, 94, 94, 94, 94,
638 94, 94, 94, 94, 94, 94, 95, 96, 96, 97,
639 97, 98, 99, 99, 99, 100, 100
642 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
643 static const yytype_uint8 yyr2
[] =
645 0, 2, 2, 1, 3, 0, 2, 2, 2, 4,
646 3, 1, 1, 1, 1, 1, 1, 3, 2, 3,
647 2, 0, 2, 2, 2, 3, 4, 4, 4, 4,
648 5, 3, 3, 3, 3, 2, 1, 3, 0, 2,
649 2, 2, 4, 3, 2, 4, 1, 1, 1, 1,
650 1, 1, 1, 1, 1, 0, 2, 3, 1, 3,
651 3, 2, 1, 3, 0, 2, 2, 3, 3, 2,
652 0, 2, 2, 2, 4, 3, 0, 2, 1, 1,
653 2, 2, 2, 0, 2, 1, 3, 3, 3, 3,
654 3, 3, 3, 2, 3, 3, 1, 1, 1, 0,
659 #define yyerrok (yyerrstatus = 0)
660 #define yyclearin (yychar = YYEMPTY)
664 #define YYACCEPT goto yyacceptlab
665 #define YYABORT goto yyabortlab
666 #define YYERROR goto yyerrorlab
669 #define YYRECOVERING() (!!yyerrstatus)
671 #define YYBACKUP(Token, Value) \
673 if (yychar == YYEMPTY) \
677 YYPOPSTACK (yylen); \
683 yyerror (YY_("syntax error: cannot back up")); \
688 /* Error token number */
690 #define YYERRCODE 256
694 /* Enable debugging if requested. */
698 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
699 # define YYFPRINTF fprintf
702 # define YYDPRINTF(Args) \
708 /* This macro is provided for backward compatibility. */
709 #ifndef YY_LOCATION_PRINT
710 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
714 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
718 YYFPRINTF (stderr, "%s ", Title); \
719 yy_symbol_print (stderr, \
721 YYFPRINTF (stderr, "\n"); \
726 /*-----------------------------------.
727 | Print this symbol's value on YYO. |
728 `-----------------------------------*/
731 yy_symbol_value_print (FILE *yyo
, int yytype
, YYSTYPE
const * const yyvaluep
)
733 FILE *yyoutput
= yyo
;
738 if (yytype
< YYNTOKENS
)
739 YYPRINT (yyo
, yytoknum
[yytype
], *yyvaluep
);
741 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
743 YY_IGNORE_MAYBE_UNINITIALIZED_END
747 /*---------------------------.
748 | Print this symbol on YYO. |
749 `---------------------------*/
752 yy_symbol_print (FILE *yyo
, int yytype
, YYSTYPE
const * const yyvaluep
)
754 YYFPRINTF (yyo
, "%s %s (",
755 yytype
< YYNTOKENS
? "token" : "nterm", yytname
[yytype
]);
757 yy_symbol_value_print (yyo
, yytype
, yyvaluep
);
758 YYFPRINTF (yyo
, ")");
761 /*------------------------------------------------------------------.
762 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
764 `------------------------------------------------------------------*/
767 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
769 YYFPRINTF (stderr
, "Stack now");
770 for (; yybottom
<= yytop
; yybottom
++)
772 int yybot
= *yybottom
;
773 YYFPRINTF (stderr
, " %d", yybot
);
775 YYFPRINTF (stderr
, "\n");
778 # define YY_STACK_PRINT(Bottom, Top) \
781 yy_stack_print ((Bottom), (Top)); \
785 /*------------------------------------------------.
786 | Report that the YYRULE is going to be reduced. |
787 `------------------------------------------------*/
790 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, int yyrule
)
792 unsigned long yylno
= yyrline
[yyrule
];
793 int yynrhs
= yyr2
[yyrule
];
795 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
797 /* The symbols being reduced. */
798 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
800 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
801 yy_symbol_print (stderr
,
802 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
803 &yyvsp
[(yyi
+ 1) - (yynrhs
)]
805 YYFPRINTF (stderr
, "\n");
809 # define YY_REDUCE_PRINT(Rule) \
812 yy_reduce_print (yyssp, yyvsp, Rule); \
815 /* Nonzero means print parse trace. It is left uninitialized so that
816 multiple parsers can coexist. */
819 # define YYDPRINTF(Args)
820 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
821 # define YY_STACK_PRINT(Bottom, Top)
822 # define YY_REDUCE_PRINT(Rule)
823 #endif /* !YYDEBUG */
826 /* YYINITDEPTH -- initial size of the parser's stacks. */
828 # define YYINITDEPTH 200
831 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
832 if the built-in stack extension method is used).
834 Do not make this value too large; the results are undefined if
835 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
836 evaluated with infinite-precision integer arithmetic. */
839 # define YYMAXDEPTH 10000
846 # if defined __GLIBC__ && defined _STRING_H
847 # define yystrlen strlen
849 /* Return the length of YYSTR. */
851 yystrlen (const char *yystr
)
854 for (yylen
= 0; yystr
[yylen
]; yylen
++)
862 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
863 # define yystpcpy stpcpy
865 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
868 yystpcpy (char *yydest
, const char *yysrc
)
871 const char *yys
= yysrc
;
873 while ((*yyd
++ = *yys
++) != '\0')
882 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
883 quotes and backslashes, so that it's suitable for yyerror. The
884 heuristic is that double-quoting is unnecessary unless the string
885 contains an apostrophe, a comma, or backslash (other than
886 backslash-backslash). YYSTR is taken from yytname. If YYRES is
887 null, do not copy; instead, return the length of what the result
890 yytnamerr (char *yyres
, const char *yystr
)
895 char const *yyp
= yystr
;
902 goto do_not_strip_quotes
;
906 goto do_not_strip_quotes
;
922 do_not_strip_quotes
: ;
926 return yystrlen (yystr
);
928 return (YYSIZE_T
) (yystpcpy (yyres
, yystr
) - yyres
);
932 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
933 about the unexpected token YYTOKEN for the state stack whose top is
936 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
937 not large enough to hold the message. In that case, also set
938 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
939 required number of bytes is too large to store. */
941 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
942 yytype_int16
*yyssp
, int yytoken
)
944 YYSIZE_T yysize0
= yytnamerr (YY_NULLPTR
, yytname
[yytoken
]);
945 YYSIZE_T yysize
= yysize0
;
946 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
947 /* Internationalized format string. */
948 const char *yyformat
= YY_NULLPTR
;
949 /* Arguments of yyformat. */
950 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
951 /* Number of reported tokens (one for the "unexpected", one per
955 /* There are many possibilities here to consider:
956 - If this state is a consistent state with a default action, then
957 the only way this function was invoked is if the default action
958 is an error action. In that case, don't check for expected
959 tokens because there are none.
960 - The only way there can be no lookahead present (in yychar) is if
961 this state is a consistent state with a default action. Thus,
962 detecting the absence of a lookahead is sufficient to determine
963 that there is no unexpected or expected token to report. In that
964 case, just report a simple "syntax error".
965 - Don't assume there isn't a lookahead just because this state is a
966 consistent state with a default action. There might have been a
967 previous inconsistent state, consistent state with a non-default
968 action, or user semantic action that manipulated yychar.
969 - Of course, the expected token list depends on states to have
970 correct lookahead information, and it depends on the parser not
971 to perform extra reductions after fetching a lookahead from the
972 scanner and before detecting a syntax error. Thus, state merging
973 (from LALR or IELR) and default reductions corrupt the expected
974 token list. However, the list is correct for canonical LR with
975 one exception: it will still contain any token that will not be
976 accepted due to an error action in a later state.
978 if (yytoken
!= YYEMPTY
)
980 int yyn
= yypact
[*yyssp
];
981 yyarg
[yycount
++] = yytname
[yytoken
];
982 if (!yypact_value_is_default (yyn
))
984 /* Start YYX at -YYN if negative to avoid negative indexes in
985 YYCHECK. In other words, skip the first -YYN actions for
986 this state because they are default actions. */
987 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
988 /* Stay within bounds of both yycheck and yytname. */
989 int yychecklim
= YYLAST
- yyn
+ 1;
990 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
993 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
994 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
995 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
997 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1003 yyarg
[yycount
++] = yytname
[yyx
];
1005 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULLPTR
, yytname
[yyx
]);
1006 if (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
)
1017 # define YYCASE_(N, S) \
1021 default: /* Avoid compiler warnings. */
1022 YYCASE_(0, YY_("syntax error"));
1023 YYCASE_(1, YY_("syntax error, unexpected %s"));
1024 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1025 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1026 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1027 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1032 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1033 if (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
)
1039 if (*yymsg_alloc
< yysize
)
1041 *yymsg_alloc
= 2 * yysize
;
1042 if (! (yysize
<= *yymsg_alloc
1043 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1044 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1048 /* Avoid sprintf, as that infringes on the user's name space.
1049 Don't have undefined behavior even if the translation
1050 produced a string with the wrong number of "%s"s. */
1054 while ((*yyp
= *yyformat
) != '\0')
1055 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1057 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1068 #endif /* YYERROR_VERBOSE */
1070 /*-----------------------------------------------.
1071 | Release the memory associated to this symbol. |
1072 `-----------------------------------------------*/
1075 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1080 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1082 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1085 case 65: /* choice_entry */
1087 fprintf(stderr
, "%s:%d: missing end statement for this entry\n",
1088 ((*yyvaluep
).menu
)->file
->name
, ((*yyvaluep
).menu
)->lineno
);
1089 if (current_menu
== ((*yyvaluep
).menu
))
1094 case 74: /* if_entry */
1096 fprintf(stderr
, "%s:%d: missing end statement for this entry\n",
1097 ((*yyvaluep
).menu
)->file
->name
, ((*yyvaluep
).menu
)->lineno
);
1098 if (current_menu
== ((*yyvaluep
).menu
))
1103 case 78: /* menu_entry */
1105 fprintf(stderr
, "%s:%d: missing end statement for this entry\n",
1106 ((*yyvaluep
).menu
)->file
->name
, ((*yyvaluep
).menu
)->lineno
);
1107 if (current_menu
== ((*yyvaluep
).menu
))
1115 YY_IGNORE_MAYBE_UNINITIALIZED_END
1121 /* The lookahead symbol. */
1124 /* The semantic value of the lookahead symbol. */
1126 /* Number of syntax errors so far. */
1138 /* Number of tokens to shift before error messages enabled. */
1141 /* The stacks and their tools:
1142 'yyss': related to states.
1143 'yyvs': related to semantic values.
1145 Refer to the stacks through separate pointers, to allow yyoverflow
1146 to reallocate them elsewhere. */
1148 /* The state stack. */
1149 yytype_int16 yyssa
[YYINITDEPTH
];
1151 yytype_int16
*yyssp
;
1153 /* The semantic value stack. */
1154 YYSTYPE yyvsa
[YYINITDEPTH
];
1158 YYSIZE_T yystacksize
;
1162 /* Lookahead token as an internal (translated) token number. */
1164 /* The variables used to return semantic value and location from the
1169 /* Buffer for error messages, and its allocated size. */
1171 char *yymsg
= yymsgbuf
;
1172 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1175 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1177 /* The number of symbols on the RHS of the reduced rule.
1178 Keep to zero when no symbol should be popped. */
1181 yyssp
= yyss
= yyssa
;
1182 yyvsp
= yyvs
= yyvsa
;
1183 yystacksize
= YYINITDEPTH
;
1185 YYDPRINTF ((stderr
, "Starting parse\n"));
1190 yychar
= YYEMPTY
; /* Cause a token to be read. */
1194 /*------------------------------------------------------------.
1195 | yynewstate -- push a new state, which is found in yystate. |
1196 `------------------------------------------------------------*/
1198 /* In all cases, when you get here, the value and location stacks
1199 have just been pushed. So pushing a state here evens the stacks. */
1203 /*--------------------------------------------------------------------.
1204 | yynewstate -- set current state (the top of the stack) to yystate. |
1205 `--------------------------------------------------------------------*/
1207 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1208 YY_ASSERT (0 <= yystate
&& yystate
< YYNSTATES
);
1209 *yyssp
= (yytype_int16
) yystate
;
1211 if (yyss
+ yystacksize
- 1 <= yyssp
)
1212 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1213 goto yyexhaustedlab
;
1216 /* Get the current used size of the three stacks, in elements. */
1217 YYSIZE_T yysize
= (YYSIZE_T
) (yyssp
- yyss
+ 1);
1219 # if defined yyoverflow
1221 /* Give user a chance to reallocate the stack. Use copies of
1222 these so that the &'s don't force the real ones into
1224 YYSTYPE
*yyvs1
= yyvs
;
1225 yytype_int16
*yyss1
= yyss
;
1227 /* Each stack pointer address is followed by the size of the
1228 data in use in that stack, in bytes. This used to be a
1229 conditional around just the two extra args, but that might
1230 be undefined if yyoverflow is a macro. */
1231 yyoverflow (YY_("memory exhausted"),
1232 &yyss1
, yysize
* sizeof (*yyssp
),
1233 &yyvs1
, yysize
* sizeof (*yyvsp
),
1238 # else /* defined YYSTACK_RELOCATE */
1239 /* Extend the stack our own way. */
1240 if (YYMAXDEPTH
<= yystacksize
)
1241 goto yyexhaustedlab
;
1243 if (YYMAXDEPTH
< yystacksize
)
1244 yystacksize
= YYMAXDEPTH
;
1247 yytype_int16
*yyss1
= yyss
;
1248 union yyalloc
*yyptr
=
1249 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1251 goto yyexhaustedlab
;
1252 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1253 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1254 # undef YYSTACK_RELOCATE
1256 YYSTACK_FREE (yyss1
);
1260 yyssp
= yyss
+ yysize
- 1;
1261 yyvsp
= yyvs
+ yysize
- 1;
1263 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1264 (unsigned long) yystacksize
));
1266 if (yyss
+ yystacksize
- 1 <= yyssp
)
1269 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1271 if (yystate
== YYFINAL
)
1281 /* Do appropriate processing given the current state. Read a
1282 lookahead token if we need one and don't already have one. */
1284 /* First try to decide what to do without reference to lookahead token. */
1285 yyn
= yypact
[yystate
];
1286 if (yypact_value_is_default (yyn
))
1289 /* Not known => get a lookahead token if don't already have one. */
1291 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1292 if (yychar
== YYEMPTY
)
1294 YYDPRINTF ((stderr
, "Reading a token: "));
1295 yychar
= yylex_proc ();
1298 if (yychar
<= YYEOF
)
1300 yychar
= yytoken
= YYEOF
;
1301 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1305 yytoken
= YYTRANSLATE (yychar
);
1306 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1309 /* If the proper action on seeing token YYTOKEN is to reduce or to
1310 detect an error, take that action. */
1312 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1317 if (yytable_value_is_error (yyn
))
1323 /* Count tokens shifted since error; after three, turn off error
1328 /* Shift the lookahead token. */
1329 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1331 /* Discard the shifted token. */
1335 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1337 YY_IGNORE_MAYBE_UNINITIALIZED_END
1341 /*-----------------------------------------------------------.
1342 | yydefault -- do the default action for the current state. |
1343 `-----------------------------------------------------------*/
1345 yyn
= yydefact
[yystate
];
1351 /*-----------------------------.
1352 | yyreduce -- do a reduction. |
1353 `-----------------------------*/
1355 /* yyn is the number of a rule to reduce with. */
1358 /* If YYLEN is nonzero, implement the default value of the action:
1361 Otherwise, the following line sets YYVAL to garbage.
1362 This behavior is undocumented and Bison
1363 users should not rely upon it. Assigning to YYVAL
1364 unconditionally makes the parser a bit smaller, and it avoids a
1365 GCC warning that YYVAL may be used uninitialized. */
1366 yyval
= yyvsp
[1-yylen
];
1369 YY_REDUCE_PRINT (yyn
);
1374 menu_add_prompt(P_MENU
, (yyvsp
[-1].string
), NULL
);
1379 { zconf_error("unknown statement \"%s\"", (yyvsp
[-2].string
)); }
1383 { zconf_error("invalid statement (%s)\n(%s)\n(%s)\n(%s)\n", (yyvsp
[0].string
),
1386 (yyvsp
[2].string
)); }
1391 (yyvsp
[-1].symbol
)->flags
|= SYMBOL_OPTIONAL
;
1392 menu_add_entry((yyvsp
[-1].symbol
));
1393 printd(DEBUG_PARSE
, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp
[-1].symbol
)->name
);
1399 printd(DEBUG_PARSE
, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1405 (yyvsp
[-1].symbol
)->flags
|= SYMBOL_OPTIONAL
;
1406 menu_add_entry((yyvsp
[-1].symbol
));
1407 printd(DEBUG_PARSE
, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp
[-1].symbol
)->name
);
1413 if (current_entry
->prompt
)
1414 current_entry
->prompt
->type
= P_MENU
;
1416 zconfprint("warning: menuconfig statement without prompt");
1417 printd(DEBUG_PARSE
, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1423 menu_set_type((yyvsp
[-2].type
));
1424 printd(DEBUG_PARSE
, "%s:%d:type(%u)\n",
1425 zconf_curname(), zconf_lineno(),
1432 menu_add_prompt(P_PROMPT
, (yyvsp
[-2].string
), (yyvsp
[-1].expr
));
1433 printd(DEBUG_PARSE
, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1439 menu_add_expr(P_DEFAULT
, (yyvsp
[-2].expr
), (yyvsp
[-1].expr
));
1440 if ((yyvsp
[-3].type
) != S_UNKNOWN
)
1441 menu_set_type((yyvsp
[-3].type
));
1442 printd(DEBUG_PARSE
, "%s:%d:default(%u)\n",
1443 zconf_curname(), zconf_lineno(),
1450 menu_add_symbol(P_SELECT
, (yyvsp
[-2].symbol
), (yyvsp
[-1].expr
));
1451 printd(DEBUG_PARSE
, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1457 menu_add_symbol(P_IMPLY
, (yyvsp
[-2].symbol
), (yyvsp
[-1].expr
));
1458 printd(DEBUG_PARSE
, "%s:%d:imply\n", zconf_curname(), zconf_lineno());
1464 menu_add_expr(P_RANGE
, expr_alloc_comp(E_RANGE
,(yyvsp
[-3].symbol
), (yyvsp
[-2].symbol
)), (yyvsp
[-1].expr
));
1465 printd(DEBUG_PARSE
, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1471 menu_add_option_modules();
1477 menu_add_option_defconfig_list();
1483 menu_add_option_allnoconfig_y();
1489 struct symbol
*sym
= sym_lookup((yyvsp
[-1].string
), SYMBOL_CHOICE
);
1490 sym
->flags
|= SYMBOL_NO_WRITE
;
1491 menu_add_entry(sym
);
1492 menu_add_expr(P_CHOICE
, NULL
, NULL
);
1493 free((yyvsp
[-1].string
));
1494 printd(DEBUG_PARSE
, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1500 (yyval
.menu
) = menu_add_menu();
1506 if (zconf_endtoken((yyvsp
[0].string
), "choice")) {
1508 printd(DEBUG_PARSE
, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1515 menu_add_prompt(P_PROMPT
, (yyvsp
[-2].string
), (yyvsp
[-1].expr
));
1516 printd(DEBUG_PARSE
, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1522 menu_set_type((yyvsp
[-2].type
));
1523 printd(DEBUG_PARSE
, "%s:%d:type(%u)\n",
1524 zconf_curname(), zconf_lineno(), (yyvsp
[-2].type
));
1530 current_entry
->sym
->flags
|= SYMBOL_OPTIONAL
;
1531 printd(DEBUG_PARSE
, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1537 menu_add_symbol(P_DEFAULT
, (yyvsp
[-2].symbol
), (yyvsp
[-1].expr
));
1538 printd(DEBUG_PARSE
, "%s:%d:default\n",
1539 zconf_curname(), zconf_lineno());
1544 { (yyval
.type
) = S_INT
; }
1548 { (yyval
.type
) = S_HEX
; }
1552 { (yyval
.type
) = S_STRING
; }
1556 { (yyval
.type
) = S_BOOLEAN
; }
1560 { (yyval
.type
) = S_TRISTATE
; }
1564 { (yyval
.type
) = S_UNKNOWN
; }
1568 { (yyval
.type
) = S_BOOLEAN
; }
1572 { (yyval
.type
) = S_TRISTATE
; }
1577 printd(DEBUG_PARSE
, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1578 menu_add_entry(NULL
);
1579 menu_add_dep((yyvsp
[-1].expr
));
1580 (yyval
.menu
) = menu_add_menu();
1586 if (zconf_endtoken((yyvsp
[0].string
), "if")) {
1588 printd(DEBUG_PARSE
, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1595 menu_add_entry(NULL
);
1596 menu_add_prompt(P_MENU
, (yyvsp
[-1].string
), NULL
);
1597 printd(DEBUG_PARSE
, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1603 (yyval
.menu
) = menu_add_menu();
1609 if (zconf_endtoken((yyvsp
[0].string
), "menu")) {
1611 printd(DEBUG_PARSE
, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
1618 printd(DEBUG_PARSE
, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp
[-1].string
));
1619 printf("%s\n", (yyvsp
[-1].string
));
1620 system("echo ${PWD}\n");
1621 system("echo BR2_BASE_DIR=${BR2_BASE_DIR}\n");
1622 system("echo BASE_DIR=${BASE_DIR}\n");
1623 zconf_nextfile((yyvsp
[-1].string
));
1624 free((yyvsp
[-1].string
));
1630 menu_add_entry(NULL
);
1631 menu_add_prompt(P_COMMENT
, (yyvsp
[-1].string
), NULL
);
1632 printd(DEBUG_PARSE
, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1638 printd(DEBUG_PARSE
, "%s:%d:help\n", zconf_curname(), zconf_lineno());
1645 if (current_entry
->help
) {
1646 free(current_entry
->help
);
1647 zconfprint("warning: '%s' defined with more than one help text -- only the last one will be used",
1648 current_entry
->sym
->name
?: "<choice>");
1651 /* Is the help text empty or all whitespace? */
1652 if ((yyvsp
[0].string
)[strspn((yyvsp
[0].string
), " \f\n\r\t\v")] == '\0')
1653 zconfprint("warning: '%s' defined with blank help text",
1654 current_entry
->sym
->name
?: "<choice>");
1656 current_entry
->help
= (yyvsp
[0].string
);
1662 menu_add_dep((yyvsp
[-1].expr
));
1663 printd(DEBUG_PARSE
, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1669 menu_add_visibility((yyvsp
[-1].expr
));
1675 menu_add_prompt(P_PROMPT
, (yyvsp
[-1].string
), (yyvsp
[0].expr
));
1680 { (yyval
.string
) = "menu"; }
1684 { (yyval
.string
) = "choice"; }
1688 { (yyval
.string
) = "if"; }
1692 { (yyval
.expr
) = NULL
; }
1696 { (yyval
.expr
) = (yyvsp
[0].expr
); }
1700 { (yyval
.expr
) = expr_alloc_symbol((yyvsp
[0].symbol
)); }
1704 { (yyval
.expr
) = expr_alloc_comp(E_LTH
, (yyvsp
[-2].symbol
), (yyvsp
[0].symbol
)); }
1708 { (yyval
.expr
) = expr_alloc_comp(E_LEQ
, (yyvsp
[-2].symbol
), (yyvsp
[0].symbol
)); }
1712 { (yyval
.expr
) = expr_alloc_comp(E_GTH
, (yyvsp
[-2].symbol
), (yyvsp
[0].symbol
)); }
1716 { (yyval
.expr
) = expr_alloc_comp(E_GEQ
, (yyvsp
[-2].symbol
), (yyvsp
[0].symbol
)); }
1720 { (yyval
.expr
) = expr_alloc_comp(E_EQUAL
, (yyvsp
[-2].symbol
), (yyvsp
[0].symbol
)); }
1724 { (yyval
.expr
) = expr_alloc_comp(E_UNEQUAL
, (yyvsp
[-2].symbol
), (yyvsp
[0].symbol
)); }
1728 { (yyval
.expr
) = (yyvsp
[-1].expr
); }
1732 { (yyval
.expr
) = expr_alloc_one(E_NOT
, (yyvsp
[0].expr
)); }
1736 { (yyval
.expr
) = expr_alloc_two(E_OR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
1740 { (yyval
.expr
) = expr_alloc_two(E_AND
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
1744 { (yyval
.symbol
) = sym_lookup((yyvsp
[0].string
), 0); free((yyvsp
[0].string
)); }
1748 { (yyval
.symbol
) = sym_lookup((yyvsp
[0].string
), SYMBOL_CONST
); free((yyvsp
[0].string
)); }
1752 { (yyval
.string
) = NULL
; }
1756 { variable_add((yyvsp
[-3].string
), (yyvsp
[-1].string
), (yyvsp
[-2].flavor
)); free((yyvsp
[-3].string
)); free((yyvsp
[-1].string
)); }
1760 { (yyval
.flavor
) = VAR_RECURSIVE
; }
1764 { (yyval
.flavor
) = VAR_SIMPLE
; }
1768 { (yyval
.flavor
) = VAR_APPEND
; }
1772 { (yyval
.string
) = xstrdup(""); }
1779 /* User semantic actions sometimes alter yychar, and that requires
1780 that yytoken be updated with the new translation. We take the
1781 approach of translating immediately before every use of yytoken.
1782 One alternative is translating here after every semantic action,
1783 but that translation would be missed if the semantic action invokes
1784 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1785 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1786 incorrect destructor might then be invoked immediately. In the
1787 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1788 to an incorrect destructor call or verbose syntax error message
1789 before the lookahead is translated. */
1790 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
1794 YY_STACK_PRINT (yyss
, yyssp
);
1798 /* Now 'shift' the result of the reduction. Determine what state
1799 that goes to, based on the state we popped back to and the rule
1800 number reduced by. */
1802 const int yylhs
= yyr1
[yyn
] - YYNTOKENS
;
1803 const int yyi
= yypgoto
[yylhs
] + *yyssp
;
1804 yystate
= (0 <= yyi
&& yyi
<= YYLAST
&& yycheck
[yyi
] == *yyssp
1806 : yydefgoto
[yylhs
]);
1812 /*--------------------------------------.
1813 | yyerrlab -- here on detecting error. |
1814 `--------------------------------------*/
1816 /* Make sure we have latest lookahead translation. See comments at
1817 user semantic actions for why this is necessary. */
1818 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
1820 /* If not already recovering from an error, report this error. */
1824 #if ! YYERROR_VERBOSE
1825 yyerror (YY_("syntax error ..."));
1827 zconf_error("invalid statement (%s)\n(%s)\n(%s)\n(%s)\n", (yyvsp
[0].string
),
1832 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1835 char const *yymsgp
= YY_("syntax error");
1836 int yysyntax_error_status
;
1837 yysyntax_error_status
= YYSYNTAX_ERROR
;
1838 if (yysyntax_error_status
== 0)
1840 else if (yysyntax_error_status
== 1)
1842 if (yymsg
!= yymsgbuf
)
1843 YYSTACK_FREE (yymsg
);
1844 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
1848 yymsg_alloc
= sizeof yymsgbuf
;
1849 yysyntax_error_status
= 2;
1853 yysyntax_error_status
= YYSYNTAX_ERROR
;
1858 if (yysyntax_error_status
== 2)
1859 goto yyexhaustedlab
;
1861 # undef YYSYNTAX_ERROR
1867 if (yyerrstatus
== 3)
1869 /* If just tried and failed to reuse lookahead token after an
1870 error, discard it. */
1872 if (yychar
<= YYEOF
)
1874 /* Return failure if at end of input. */
1875 if (yychar
== YYEOF
)
1880 yydestruct ("Error: discarding",
1886 /* Else will try to reuse lookahead token after shifting the error
1891 /*---------------------------------------------------.
1892 | yyerrorlab -- error raised explicitly by YYERROR. |
1893 `---------------------------------------------------*/
1895 /* Pacify compilers when the user code never invokes YYERROR and the
1896 label yyerrorlab therefore never appears in user code. */
1900 /* Do not reclaim the symbols of the rule whose action triggered
1904 YY_STACK_PRINT (yyss
, yyssp
);
1909 /*-------------------------------------------------------------.
1910 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1911 `-------------------------------------------------------------*/
1913 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1917 yyn
= yypact
[yystate
];
1918 if (!yypact_value_is_default (yyn
))
1921 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1929 /* Pop the current state because it cannot handle the error token. */
1934 yydestruct ("Error: popping",
1935 yystos
[yystate
], yyvsp
);
1938 YY_STACK_PRINT (yyss
, yyssp
);
1941 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1943 YY_IGNORE_MAYBE_UNINITIALIZED_END
1946 /* Shift the error token. */
1947 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
1953 /*-------------------------------------.
1954 | yyacceptlab -- YYACCEPT comes here. |
1955 `-------------------------------------*/
1961 /*-----------------------------------.
1962 | yyabortlab -- YYABORT comes here. |
1963 `-----------------------------------*/
1969 #if !defined yyoverflow || YYERROR_VERBOSE
1970 /*-------------------------------------------------.
1971 | yyexhaustedlab -- memory exhaustion comes here. |
1972 `-------------------------------------------------*/
1974 yyerror (YY_("memory exhausted"));
1980 /*-----------------------------------------------------.
1981 | yyreturn -- parsing is finished, return the result. |
1982 `-----------------------------------------------------*/
1984 if (yychar
!= YYEMPTY
)
1986 /* Make sure we have latest lookahead translation. See comments at
1987 user semantic actions for why this is necessary. */
1988 yytoken
= YYTRANSLATE (yychar
);
1989 yydestruct ("Cleanup: discarding lookahead",
1992 /* Do not reclaim the symbols of the rule whose action triggered
1993 this YYABORT or YYACCEPT. */
1995 YY_STACK_PRINT (yyss
, yyssp
);
1996 while (yyssp
!= yyss
)
1998 yydestruct ("Cleanup: popping",
1999 yystos
[*yyssp
], yyvsp
);
2004 YYSTACK_FREE (yyss
);
2007 if (yymsg
!= yymsgbuf
)
2008 YYSTACK_FREE (yymsg
);
2014 #include "parser.gmrproc.c"