diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2005-11-09 00:34:51 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:55:53 -0500 |
commit | 7a88488bbc231e48a4a88ee2569bc0cc5d706f0a (patch) | |
tree | 2fd6b51b5cf76dd37a2a369a29c50b5121c12a92 /scripts/kconfig/zconf.tab.c_shipped | |
parent | 491d711035dc08071ed58cf470f15efadb67cb1c (diff) |
[PATCH] kconfig: use gperf for kconfig keywords
Use gperf to generate a hash for the kconfig keywords. This greatly reduces
the size of the generated scanner and makes it easier to extend kconfig.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'scripts/kconfig/zconf.tab.c_shipped')
-rw-r--r-- | scripts/kconfig/zconf.tab.c_shipped | 455 |
1 files changed, 261 insertions, 194 deletions
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped index da12f7b33be3..07fa508d4659 100644 --- a/scripts/kconfig/zconf.tab.c_shipped +++ b/scripts/kconfig/zconf.tab.c_shipped | |||
@@ -1,7 +1,7 @@ | |||
1 | /* A Bison parser, made by GNU Bison 1.875a. */ | 1 | /* A Bison parser, made by GNU Bison 2.0. */ |
2 | 2 | ||
3 | /* Skeleton parser for Yacc-like parsing with Bison, | 3 | /* Skeleton parser for Yacc-like parsing with Bison, |
4 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. | 4 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
@@ -45,8 +45,7 @@ | |||
45 | /* Using locations. */ | 45 | /* Using locations. */ |
46 | #define YYLSP_NEEDED 0 | 46 | #define YYLSP_NEEDED 0 |
47 | 47 | ||
48 | /* If NAME_PREFIX is specified substitute the variables and functions | 48 | /* Substitute the variable and function names. */ |
49 | names. */ | ||
50 | #define yyparse zconfparse | 49 | #define yyparse zconfparse |
51 | #define yylex zconflex | 50 | #define yylex zconflex |
52 | #define yyerror zconferror | 51 | #define yyerror zconferror |
@@ -161,6 +160,11 @@ | |||
161 | #include <string.h> | 160 | #include <string.h> |
162 | #include <stdbool.h> | 161 | #include <stdbool.h> |
163 | 162 | ||
163 | #define LKC_DIRECT_LINK | ||
164 | #include "lkc.h" | ||
165 | |||
166 | #include "zconf.hash.c" | ||
167 | |||
164 | #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) | 168 | #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) |
165 | 169 | ||
166 | #define PRINTD 0x0001 | 170 | #define PRINTD 0x0001 |
@@ -202,7 +206,7 @@ typedef union YYSTYPE { | |||
202 | struct expr *expr; | 206 | struct expr *expr; |
203 | struct menu *menu; | 207 | struct menu *menu; |
204 | } YYSTYPE; | 208 | } YYSTYPE; |
205 | /* Line 191 of yacc.c. */ | 209 | /* Line 190 of yacc.c. */ |
206 | 210 | ||
207 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ | 211 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
208 | # define YYSTYPE_IS_DECLARED 1 | 212 | # define YYSTYPE_IS_DECLARED 1 |
@@ -214,27 +218,26 @@ typedef union YYSTYPE { | |||
214 | /* Copy the second part of user declarations. */ | 218 | /* Copy the second part of user declarations. */ |
215 | 219 | ||
216 | 220 | ||
217 | #define LKC_DIRECT_LINK | 221 | /* Line 213 of yacc.c. */ |
218 | #include "lkc.h" | ||
219 | |||
220 | |||
221 | /* Line 214 of yacc.c. */ | ||
222 | 222 | ||
223 | 223 | ||
224 | #if ! defined (yyoverflow) || YYERROR_VERBOSE | 224 | #if ! defined (yyoverflow) || YYERROR_VERBOSE |
225 | 225 | ||
226 | # ifndef YYFREE | ||
227 | # define YYFREE free | ||
228 | # endif | ||
229 | # ifndef YYMALLOC | ||
230 | # define YYMALLOC malloc | ||
231 | # endif | ||
232 | |||
226 | /* The parser invokes alloca or malloc; define the necessary symbols. */ | 233 | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
227 | 234 | ||
228 | # if YYSTACK_USE_ALLOCA | 235 | # ifdef YYSTACK_USE_ALLOCA |
229 | # define YYSTACK_ALLOC alloca | 236 | # if YYSTACK_USE_ALLOCA |
230 | # else | 237 | # ifdef __GNUC__ |
231 | # ifndef YYSTACK_USE_ALLOCA | 238 | # define YYSTACK_ALLOC __builtin_alloca |
232 | # if defined (alloca) || defined (_ALLOCA_H) | ||
233 | # define YYSTACK_ALLOC alloca | ||
234 | # else | 239 | # else |
235 | # ifdef __GNUC__ | 240 | # define YYSTACK_ALLOC alloca |
236 | # define YYSTACK_ALLOC __builtin_alloca | ||
237 | # endif | ||
238 | # endif | 241 | # endif |
239 | # endif | 242 | # endif |
240 | # endif | 243 | # endif |
@@ -247,20 +250,20 @@ typedef union YYSTYPE { | |||
247 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | 250 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
248 | # define YYSIZE_T size_t | 251 | # define YYSIZE_T size_t |
249 | # endif | 252 | # endif |
250 | # define YYSTACK_ALLOC malloc | 253 | # define YYSTACK_ALLOC YYMALLOC |
251 | # define YYSTACK_FREE free | 254 | # define YYSTACK_FREE YYFREE |
252 | # endif | 255 | # endif |
253 | #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ | 256 | #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ |
254 | 257 | ||
255 | 258 | ||
256 | #if (! defined (yyoverflow) \ | 259 | #if (! defined (yyoverflow) \ |
257 | && (! defined (__cplusplus) \ | 260 | && (! defined (__cplusplus) \ |
258 | || (YYSTYPE_IS_TRIVIAL))) | 261 | || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) |
259 | 262 | ||
260 | /* A type that is properly aligned for any stack member. */ | 263 | /* A type that is properly aligned for any stack member. */ |
261 | union yyalloc | 264 | union yyalloc |
262 | { | 265 | { |
263 | short yyss; | 266 | short int yyss; |
264 | YYSTYPE yyvs; | 267 | YYSTYPE yyvs; |
265 | }; | 268 | }; |
266 | 269 | ||
@@ -270,13 +273,13 @@ union yyalloc | |||
270 | /* The size of an array large to enough to hold all stacks, each with | 273 | /* The size of an array large to enough to hold all stacks, each with |
271 | N elements. */ | 274 | N elements. */ |
272 | # define YYSTACK_BYTES(N) \ | 275 | # define YYSTACK_BYTES(N) \ |
273 | ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ | 276 | ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ |
274 | + YYSTACK_GAP_MAXIMUM) | 277 | + YYSTACK_GAP_MAXIMUM) |
275 | 278 | ||
276 | /* Copy COUNT objects from FROM to TO. The source and destination do | 279 | /* Copy COUNT objects from FROM to TO. The source and destination do |
277 | not overlap. */ | 280 | not overlap. */ |
278 | # ifndef YYCOPY | 281 | # ifndef YYCOPY |
279 | # if 1 < __GNUC__ | 282 | # if defined (__GNUC__) && 1 < __GNUC__ |
280 | # define YYCOPY(To, From, Count) \ | 283 | # define YYCOPY(To, From, Count) \ |
281 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | 284 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) |
282 | # else | 285 | # else |
@@ -312,7 +315,7 @@ union yyalloc | |||
312 | #if defined (__STDC__) || defined (__cplusplus) | 315 | #if defined (__STDC__) || defined (__cplusplus) |
313 | typedef signed char yysigned_char; | 316 | typedef signed char yysigned_char; |
314 | #else | 317 | #else |
315 | typedef short yysigned_char; | 318 | typedef short int yysigned_char; |
316 | #endif | 319 | #endif |
317 | 320 | ||
318 | /* YYFINAL -- State number of the termination state. */ | 321 | /* YYFINAL -- State number of the termination state. */ |
@@ -374,7 +377,7 @@ static const unsigned char yytranslate[] = | |||
374 | #if YYDEBUG | 377 | #if YYDEBUG |
375 | /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in | 378 | /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in |
376 | YYRHS. */ | 379 | YYRHS. */ |
377 | static const unsigned short yyprhs[] = | 380 | static const unsigned short int yyprhs[] = |
378 | { | 381 | { |
379 | 0, 0, 3, 4, 7, 9, 11, 13, 17, 19, | 382 | 0, 0, 3, 4, 7, 9, 11, 13, 17, 19, |
380 | 21, 23, 26, 28, 30, 32, 34, 36, 38, 42, | 383 | 21, 23, 26, 28, 30, 32, 34, 36, 38, 42, |
@@ -427,19 +430,19 @@ static const yysigned_char yyrhs[] = | |||
427 | }; | 430 | }; |
428 | 431 | ||
429 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | 432 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
430 | static const unsigned short yyrline[] = | 433 | static const unsigned short int yyrline[] = |
431 | { | 434 | { |
432 | 0, 94, 94, 95, 98, 99, 100, 101, 102, 103, | 435 | 0, 97, 97, 98, 101, 102, 103, 104, 105, 106, |
433 | 104, 105, 109, 110, 111, 112, 113, 114, 120, 128, | 436 | 107, 108, 112, 113, 114, 115, 116, 117, 123, 131, |
434 | 134, 142, 152, 154, 155, 156, 157, 160, 166, 173, | 437 | 137, 145, 155, 157, 158, 159, 160, 163, 169, 176, |
435 | 179, 186, 192, 198, 204, 210, 216, 222, 230, 239, | 438 | 182, 189, 195, 201, 207, 213, 219, 225, 233, 242, |
436 | 245, 254, 255, 261, 263, 264, 265, 266, 269, 275, | 439 | 248, 257, 258, 264, 266, 267, 268, 269, 272, 278, |
437 | 281, 287, 293, 299, 301, 306, 315, 324, 325, 331, | 440 | 284, 290, 296, 302, 304, 309, 318, 327, 328, 334, |
438 | 333, 334, 335, 340, 347, 353, 362, 363, 369, 371, | 441 | 336, 337, 338, 343, 350, 356, 365, 366, 372, 374, |
439 | 372, 373, 374, 377, 383, 390, 397, 404, 410, 417, | 442 | 375, 376, 377, 380, 386, 393, 400, 407, 413, 420, |
440 | 418, 419, 422, 427, 432, 440, 442, 447, 448, 451, | 443 | 421, 422, 425, 430, 435, 443, 445, 450, 451, 454, |
441 | 452, 453, 457, 457, 459, 460, 463, 464, 465, 466, | 444 | 455, 456, 460, 460, 462, 463, 466, 467, 468, 469, |
442 | 467, 468, 469, 472, 473 | 445 | 470, 471, 472, 475, 476 |
443 | }; | 446 | }; |
444 | #endif | 447 | #endif |
445 | 448 | ||
@@ -448,29 +451,29 @@ static const unsigned short yyrline[] = | |||
448 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ | 451 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
449 | static const char *const yytname[] = | 452 | static const char *const yytname[] = |
450 | { | 453 | { |
451 | "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU", | 454 | "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU", |
452 | "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", | 455 | "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", |
453 | "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", | 456 | "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", |
454 | "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE", | 457 | "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE", |
455 | "T_DEF_TRISTATE", "T_BOOLEAN", "T_DEF_BOOLEAN", "T_STRING", "T_INT", | 458 | "T_DEF_TRISTATE", "T_BOOLEAN", "T_DEF_BOOLEAN", "T_STRING", "T_INT", |
456 | "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_EOF", "T_EOL", | 459 | "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_EOF", "T_EOL", |
457 | "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_SELECT", "T_RANGE", "T_OR", | 460 | "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_SELECT", "T_RANGE", "T_OR", |
458 | "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block", | 461 | "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block", "common_block", |
459 | "common_block", "config_entry_start", "config_stmt", | 462 | "config_entry_start", "config_stmt", "menuconfig_entry_start", |
460 | "menuconfig_entry_start", "menuconfig_stmt", "config_option_list", | 463 | "menuconfig_stmt", "config_option_list", "config_option", "choice", |
461 | "config_option", "choice", "choice_entry", "choice_end", "choice_stmt", | 464 | "choice_entry", "choice_end", "choice_stmt", "choice_option_list", |
462 | "choice_option_list", "choice_option", "choice_block", "if", "if_end", | 465 | "choice_option", "choice_block", "if", "if_end", "if_stmt", "if_block", |
463 | "if_stmt", "if_block", "menu", "menu_entry", "menu_end", "menu_stmt", | 466 | "menu", "menu_entry", "menu_end", "menu_stmt", "menu_block", "source", |
464 | "menu_block", "source", "source_stmt", "comment", "comment_stmt", | 467 | "source_stmt", "comment", "comment_stmt", "help_start", "help", |
465 | "help_start", "help", "depends_list", "depends", "prompt_stmt_opt", | 468 | "depends_list", "depends", "prompt_stmt_opt", "prompt", "end", |
466 | "prompt", "end", "nl_or_eof", "if_expr", "expr", "symbol", 0 | 469 | "nl_or_eof", "if_expr", "expr", "symbol", 0 |
467 | }; | 470 | }; |
468 | #endif | 471 | #endif |
469 | 472 | ||
470 | # ifdef YYPRINT | 473 | # ifdef YYPRINT |
471 | /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to | 474 | /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to |
472 | token YYLEX-NUM. */ | 475 | token YYLEX-NUM. */ |
473 | static const unsigned short yytoknum[] = | 476 | static const unsigned short int yytoknum[] = |
474 | { | 477 | { |
475 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, | 478 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
476 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, | 479 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
@@ -539,7 +542,7 @@ static const unsigned char yydefact[] = | |||
539 | }; | 542 | }; |
540 | 543 | ||
541 | /* YYDEFGOTO[NTERM-NUM]. */ | 544 | /* YYDEFGOTO[NTERM-NUM]. */ |
542 | static const short yydefgoto[] = | 545 | static const short int yydefgoto[] = |
543 | { | 546 | { |
544 | -1, 1, 17, 18, 19, 20, 21, 22, 52, 88, | 547 | -1, 1, 17, 18, 19, 20, 21, 22, 52, 88, |
545 | 23, 24, 105, 25, 54, 98, 55, 26, 109, 27, | 548 | 23, 24, 105, 25, 54, 98, 55, 26, 109, 27, |
@@ -551,7 +554,7 @@ static const short yydefgoto[] = | |||
551 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | 554 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
552 | STATE-NUM. */ | 555 | STATE-NUM. */ |
553 | #define YYPACT_NINF -99 | 556 | #define YYPACT_NINF -99 |
554 | static const short yypact[] = | 557 | static const short int yypact[] = |
555 | { | 558 | { |
556 | -99, 48, -99, 38, 46, 46, -99, 46, -29, -99, | 559 | -99, 48, -99, 38, 46, 46, -99, 46, -29, -99, |
557 | 46, -17, -3, -11, -99, -99, -99, -99, -99, -99, | 560 | 46, -17, -3, -11, -99, -99, -99, -99, -99, -99, |
@@ -575,7 +578,7 @@ static const short yypact[] = | |||
575 | }; | 578 | }; |
576 | 579 | ||
577 | /* YYPGOTO[NTERM-NUM]. */ | 580 | /* YYPGOTO[NTERM-NUM]. */ |
578 | static const short yypgoto[] = | 581 | static const short int yypgoto[] = |
579 | { | 582 | { |
580 | -99, -99, -99, 111, -99, -99, -99, -99, 178, -99, | 583 | -99, -99, -99, 111, -99, -99, -99, -99, 178, -99, |
581 | -99, -99, -99, 91, -99, -99, -99, -99, -99, -99, | 584 | -99, -99, -99, 91, -99, -99, -99, -99, -99, -99, |
@@ -589,7 +592,7 @@ static const short yypgoto[] = | |||
589 | number is the opposite. If zero, do what YYDEFACT says. | 592 | number is the opposite. If zero, do what YYDEFACT says. |
590 | If YYTABLE_NINF, syntax error. */ | 593 | If YYTABLE_NINF, syntax error. */ |
591 | #define YYTABLE_NINF -68 | 594 | #define YYTABLE_NINF -68 |
592 | static const short yytable[] = | 595 | static const short int yytable[] = |
593 | { | 596 | { |
594 | 66, 67, 36, 42, 39, 40, 71, 41, 123, 124, | 597 | 66, 67, 36, 42, 39, 40, 71, 41, 123, 124, |
595 | 43, 44, 74, 75, 120, 154, 72, 46, 47, 69, | 598 | 43, 44, 74, 75, 120, 154, 72, 46, 47, 69, |
@@ -687,7 +690,7 @@ static const unsigned char yystos[] = | |||
687 | 690 | ||
688 | #define YYACCEPT goto yyacceptlab | 691 | #define YYACCEPT goto yyacceptlab |
689 | #define YYABORT goto yyabortlab | 692 | #define YYABORT goto yyabortlab |
690 | #define YYERROR goto yyerrlab1 | 693 | #define YYERROR goto yyerrorlab |
691 | 694 | ||
692 | 695 | ||
693 | /* Like YYERROR except do call yyerror. This remains here temporarily | 696 | /* Like YYERROR except do call yyerror. This remains here temporarily |
@@ -715,20 +718,53 @@ do \ | |||
715 | } \ | 718 | } \ |
716 | while (0) | 719 | while (0) |
717 | 720 | ||
721 | |||
718 | #define YYTERROR 1 | 722 | #define YYTERROR 1 |
719 | #define YYERRCODE 256 | 723 | #define YYERRCODE 256 |
720 | 724 | ||
721 | /* YYLLOC_DEFAULT -- Compute the default location (before the actions | ||
722 | are run). */ | ||
723 | 725 | ||
726 | /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. | ||
727 | If N is 0, then set CURRENT to the empty location which ends | ||
728 | the previous symbol: RHS[0] (always defined). */ | ||
729 | |||
730 | #define YYRHSLOC(Rhs, K) ((Rhs)[K]) | ||
724 | #ifndef YYLLOC_DEFAULT | 731 | #ifndef YYLLOC_DEFAULT |
725 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ | 732 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ |
726 | Current.first_line = Rhs[1].first_line; \ | 733 | do \ |
727 | Current.first_column = Rhs[1].first_column; \ | 734 | if (N) \ |
728 | Current.last_line = Rhs[N].last_line; \ | 735 | { \ |
729 | Current.last_column = Rhs[N].last_column; | 736 | (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ |
737 | (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ | ||
738 | (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ | ||
739 | (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ | ||
740 | } \ | ||
741 | else \ | ||
742 | { \ | ||
743 | (Current).first_line = (Current).last_line = \ | ||
744 | YYRHSLOC (Rhs, 0).last_line; \ | ||
745 | (Current).first_column = (Current).last_column = \ | ||
746 | YYRHSLOC (Rhs, 0).last_column; \ | ||
747 | } \ | ||
748 | while (0) | ||
730 | #endif | 749 | #endif |
731 | 750 | ||
751 | |||
752 | /* YY_LOCATION_PRINT -- Print the location on the stream. | ||
753 | This macro was not mandated originally: define only if we know | ||
754 | we won't break user code: when these are the locations we know. */ | ||
755 | |||
756 | #ifndef YY_LOCATION_PRINT | ||
757 | # if YYLTYPE_IS_TRIVIAL | ||
758 | # define YY_LOCATION_PRINT(File, Loc) \ | ||
759 | fprintf (File, "%d.%d-%d.%d", \ | ||
760 | (Loc).first_line, (Loc).first_column, \ | ||
761 | (Loc).last_line, (Loc).last_column) | ||
762 | # else | ||
763 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) | ||
764 | # endif | ||
765 | #endif | ||
766 | |||
767 | |||
732 | /* YYLEX -- calling `yylex' with the right arguments. */ | 768 | /* YYLEX -- calling `yylex' with the right arguments. */ |
733 | 769 | ||
734 | #ifdef YYLEX_PARAM | 770 | #ifdef YYLEX_PARAM |
@@ -751,36 +787,30 @@ do { \ | |||
751 | YYFPRINTF Args; \ | 787 | YYFPRINTF Args; \ |
752 | } while (0) | 788 | } while (0) |
753 | 789 | ||
754 | # define YYDSYMPRINT(Args) \ | 790 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
755 | do { \ | ||
756 | if (yydebug) \ | ||
757 | yysymprint Args; \ | ||
758 | } while (0) | ||
759 | |||
760 | # define YYDSYMPRINTF(Title, Token, Value, Location) \ | ||
761 | do { \ | 791 | do { \ |
762 | if (yydebug) \ | 792 | if (yydebug) \ |
763 | { \ | 793 | { \ |
764 | YYFPRINTF (stderr, "%s ", Title); \ | 794 | YYFPRINTF (stderr, "%s ", Title); \ |
765 | yysymprint (stderr, \ | 795 | yysymprint (stderr, \ |
766 | Token, Value); \ | 796 | Type, Value); \ |
767 | YYFPRINTF (stderr, "\n"); \ | 797 | YYFPRINTF (stderr, "\n"); \ |
768 | } \ | 798 | } \ |
769 | } while (0) | 799 | } while (0) |
770 | 800 | ||
771 | /*------------------------------------------------------------------. | 801 | /*------------------------------------------------------------------. |
772 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | | 802 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
773 | | TOP (cinluded). | | 803 | | TOP (included). | |
774 | `------------------------------------------------------------------*/ | 804 | `------------------------------------------------------------------*/ |
775 | 805 | ||
776 | #if defined (__STDC__) || defined (__cplusplus) | 806 | #if defined (__STDC__) || defined (__cplusplus) |
777 | static void | 807 | static void |
778 | yy_stack_print (short *bottom, short *top) | 808 | yy_stack_print (short int *bottom, short int *top) |
779 | #else | 809 | #else |
780 | static void | 810 | static void |
781 | yy_stack_print (bottom, top) | 811 | yy_stack_print (bottom, top) |
782 | short *bottom; | 812 | short int *bottom; |
783 | short *top; | 813 | short int *top; |
784 | #endif | 814 | #endif |
785 | { | 815 | { |
786 | YYFPRINTF (stderr, "Stack now"); | 816 | YYFPRINTF (stderr, "Stack now"); |
@@ -810,9 +840,9 @@ yy_reduce_print (yyrule) | |||
810 | #endif | 840 | #endif |
811 | { | 841 | { |
812 | int yyi; | 842 | int yyi; |
813 | unsigned int yylineno = yyrline[yyrule]; | 843 | unsigned int yylno = yyrline[yyrule]; |
814 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", | 844 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", |
815 | yyrule - 1, yylineno); | 845 | yyrule - 1, yylno); |
816 | /* Print the symbols being reduced, and their result. */ | 846 | /* Print the symbols being reduced, and their result. */ |
817 | for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) | 847 | for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) |
818 | YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); | 848 | YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); |
@@ -830,8 +860,7 @@ do { \ | |||
830 | int yydebug; | 860 | int yydebug; |
831 | #else /* !YYDEBUG */ | 861 | #else /* !YYDEBUG */ |
832 | # define YYDPRINTF(Args) | 862 | # define YYDPRINTF(Args) |
833 | # define YYDSYMPRINT(Args) | 863 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
834 | # define YYDSYMPRINTF(Title, Token, Value, Location) | ||
835 | # define YY_STACK_PRINT(Bottom, Top) | 864 | # define YY_STACK_PRINT(Bottom, Top) |
836 | # define YY_REDUCE_PRINT(Rule) | 865 | # define YY_REDUCE_PRINT(Rule) |
837 | #endif /* !YYDEBUG */ | 866 | #endif /* !YYDEBUG */ |
@@ -849,10 +878,6 @@ int yydebug; | |||
849 | SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) | 878 | SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) |
850 | evaluated with infinite-precision integer arithmetic. */ | 879 | evaluated with infinite-precision integer arithmetic. */ |
851 | 880 | ||
852 | #if YYMAXDEPTH == 0 | ||
853 | # undef YYMAXDEPTH | ||
854 | #endif | ||
855 | |||
856 | #ifndef YYMAXDEPTH | 881 | #ifndef YYMAXDEPTH |
857 | # define YYMAXDEPTH 10000 | 882 | # define YYMAXDEPTH 10000 |
858 | #endif | 883 | #endif |
@@ -934,15 +959,15 @@ yysymprint (yyoutput, yytype, yyvaluep) | |||
934 | (void) yyvaluep; | 959 | (void) yyvaluep; |
935 | 960 | ||
936 | if (yytype < YYNTOKENS) | 961 | if (yytype < YYNTOKENS) |
937 | { | 962 | YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); |
938 | YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); | ||
939 | # ifdef YYPRINT | ||
940 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | ||
941 | # endif | ||
942 | } | ||
943 | else | 963 | else |
944 | YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); | 964 | YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); |
945 | 965 | ||
966 | |||
967 | # ifdef YYPRINT | ||
968 | if (yytype < YYNTOKENS) | ||
969 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | ||
970 | # endif | ||
946 | switch (yytype) | 971 | switch (yytype) |
947 | { | 972 | { |
948 | default: | 973 | default: |
@@ -958,10 +983,11 @@ yysymprint (yyoutput, yytype, yyvaluep) | |||
958 | 983 | ||
959 | #if defined (__STDC__) || defined (__cplusplus) | 984 | #if defined (__STDC__) || defined (__cplusplus) |
960 | static void | 985 | static void |
961 | yydestruct (int yytype, YYSTYPE *yyvaluep) | 986 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) |
962 | #else | 987 | #else |
963 | static void | 988 | static void |
964 | yydestruct (yytype, yyvaluep) | 989 | yydestruct (yymsg, yytype, yyvaluep) |
990 | const char *yymsg; | ||
965 | int yytype; | 991 | int yytype; |
966 | YYSTYPE *yyvaluep; | 992 | YYSTYPE *yyvaluep; |
967 | #endif | 993 | #endif |
@@ -969,6 +995,10 @@ yydestruct (yytype, yyvaluep) | |||
969 | /* Pacify ``unused variable'' warnings. */ | 995 | /* Pacify ``unused variable'' warnings. */ |
970 | (void) yyvaluep; | 996 | (void) yyvaluep; |
971 | 997 | ||
998 | if (!yymsg) | ||
999 | yymsg = "Deleting"; | ||
1000 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); | ||
1001 | |||
972 | switch (yytype) | 1002 | switch (yytype) |
973 | { | 1003 | { |
974 | 1004 | ||
@@ -996,10 +1026,10 @@ int yyparse (); | |||
996 | 1026 | ||
997 | 1027 | ||
998 | 1028 | ||
999 | /* The lookahead symbol. */ | 1029 | /* The look-ahead symbol. */ |
1000 | int yychar; | 1030 | int yychar; |
1001 | 1031 | ||
1002 | /* The semantic value of the lookahead symbol. */ | 1032 | /* The semantic value of the look-ahead symbol. */ |
1003 | YYSTYPE yylval; | 1033 | YYSTYPE yylval; |
1004 | 1034 | ||
1005 | /* Number of syntax errors so far. */ | 1035 | /* Number of syntax errors so far. */ |
@@ -1035,7 +1065,7 @@ yyparse () | |||
1035 | int yyresult; | 1065 | int yyresult; |
1036 | /* Number of tokens to shift before error messages enabled. */ | 1066 | /* Number of tokens to shift before error messages enabled. */ |
1037 | int yyerrstatus; | 1067 | int yyerrstatus; |
1038 | /* Lookahead token as an internal (translated) token number. */ | 1068 | /* Look-ahead token as an internal (translated) token number. */ |
1039 | int yytoken = 0; | 1069 | int yytoken = 0; |
1040 | 1070 | ||
1041 | /* Three stacks and their tools: | 1071 | /* Three stacks and their tools: |
@@ -1047,9 +1077,9 @@ yyparse () | |||
1047 | to reallocate them elsewhere. */ | 1077 | to reallocate them elsewhere. */ |
1048 | 1078 | ||
1049 | /* The state stack. */ | 1079 | /* The state stack. */ |
1050 | short yyssa[YYINITDEPTH]; | 1080 | short int yyssa[YYINITDEPTH]; |
1051 | short *yyss = yyssa; | 1081 | short int *yyss = yyssa; |
1052 | register short *yyssp; | 1082 | register short int *yyssp; |
1053 | 1083 | ||
1054 | /* The semantic value stack. */ | 1084 | /* The semantic value stack. */ |
1055 | YYSTYPE yyvsa[YYINITDEPTH]; | 1085 | YYSTYPE yyvsa[YYINITDEPTH]; |
@@ -1086,6 +1116,9 @@ yyparse () | |||
1086 | yyssp = yyss; | 1116 | yyssp = yyss; |
1087 | yyvsp = yyvs; | 1117 | yyvsp = yyvs; |
1088 | 1118 | ||
1119 | |||
1120 | yyvsp[0] = yylval; | ||
1121 | |||
1089 | goto yysetstate; | 1122 | goto yysetstate; |
1090 | 1123 | ||
1091 | /*------------------------------------------------------------. | 1124 | /*------------------------------------------------------------. |
@@ -1111,7 +1144,7 @@ yyparse () | |||
1111 | these so that the &'s don't force the real ones into | 1144 | these so that the &'s don't force the real ones into |
1112 | memory. */ | 1145 | memory. */ |
1113 | YYSTYPE *yyvs1 = yyvs; | 1146 | YYSTYPE *yyvs1 = yyvs; |
1114 | short *yyss1 = yyss; | 1147 | short int *yyss1 = yyss; |
1115 | 1148 | ||
1116 | 1149 | ||
1117 | /* Each stack pointer address is followed by the size of the | 1150 | /* Each stack pointer address is followed by the size of the |
@@ -1139,7 +1172,7 @@ yyparse () | |||
1139 | yystacksize = YYMAXDEPTH; | 1172 | yystacksize = YYMAXDEPTH; |
1140 | 1173 | ||
1141 | { | 1174 | { |
1142 | short *yyss1 = yyss; | 1175 | short int *yyss1 = yyss; |
1143 | union yyalloc *yyptr = | 1176 | union yyalloc *yyptr = |
1144 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | 1177 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
1145 | if (! yyptr) | 1178 | if (! yyptr) |
@@ -1175,18 +1208,18 @@ yyparse () | |||
1175 | yybackup: | 1208 | yybackup: |
1176 | 1209 | ||
1177 | /* Do appropriate processing given the current state. */ | 1210 | /* Do appropriate processing given the current state. */ |
1178 | /* Read a lookahead token if we need one and don't already have one. */ | 1211 | /* Read a look-ahead token if we need one and don't already have one. */ |
1179 | /* yyresume: */ | 1212 | /* yyresume: */ |
1180 | 1213 | ||
1181 | /* First try to decide what to do without reference to lookahead token. */ | 1214 | /* First try to decide what to do without reference to look-ahead token. */ |
1182 | 1215 | ||
1183 | yyn = yypact[yystate]; | 1216 | yyn = yypact[yystate]; |
1184 | if (yyn == YYPACT_NINF) | 1217 | if (yyn == YYPACT_NINF) |
1185 | goto yydefault; | 1218 | goto yydefault; |
1186 | 1219 | ||
1187 | /* Not known => get a lookahead token if don't already have one. */ | 1220 | /* Not known => get a look-ahead token if don't already have one. */ |
1188 | 1221 | ||
1189 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ | 1222 | /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ |
1190 | if (yychar == YYEMPTY) | 1223 | if (yychar == YYEMPTY) |
1191 | { | 1224 | { |
1192 | YYDPRINTF ((stderr, "Reading a token: ")); | 1225 | YYDPRINTF ((stderr, "Reading a token: ")); |
@@ -1201,7 +1234,7 @@ yybackup: | |||
1201 | else | 1234 | else |
1202 | { | 1235 | { |
1203 | yytoken = YYTRANSLATE (yychar); | 1236 | yytoken = YYTRANSLATE (yychar); |
1204 | YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); | 1237 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
1205 | } | 1238 | } |
1206 | 1239 | ||
1207 | /* If the proper action on seeing token YYTOKEN is to reduce or to | 1240 | /* If the proper action on seeing token YYTOKEN is to reduce or to |
@@ -1221,8 +1254,8 @@ yybackup: | |||
1221 | if (yyn == YYFINAL) | 1254 | if (yyn == YYFINAL) |
1222 | YYACCEPT; | 1255 | YYACCEPT; |
1223 | 1256 | ||
1224 | /* Shift the lookahead token. */ | 1257 | /* Shift the look-ahead token. */ |
1225 | YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); | 1258 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
1226 | 1259 | ||
1227 | /* Discard the token being shifted unless it is eof. */ | 1260 | /* Discard the token being shifted unless it is eof. */ |
1228 | if (yychar != YYEOF) | 1261 | if (yychar != YYEOF) |
@@ -1294,10 +1327,10 @@ yyreduce: | |||
1294 | case 18: | 1327 | case 18: |
1295 | 1328 | ||
1296 | { | 1329 | { |
1297 | struct symbol *sym = sym_lookup(yyvsp[-1].string, 0); | 1330 | struct symbol *sym = sym_lookup((yyvsp[-1].string), 0); |
1298 | sym->flags |= SYMBOL_OPTIONAL; | 1331 | sym->flags |= SYMBOL_OPTIONAL; |
1299 | menu_add_entry(sym); | 1332 | menu_add_entry(sym); |
1300 | printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string); | 1333 | printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string)); |
1301 | ;} | 1334 | ;} |
1302 | break; | 1335 | break; |
1303 | 1336 | ||
@@ -1312,10 +1345,10 @@ yyreduce: | |||
1312 | case 20: | 1345 | case 20: |
1313 | 1346 | ||
1314 | { | 1347 | { |
1315 | struct symbol *sym = sym_lookup(yyvsp[-1].string, 0); | 1348 | struct symbol *sym = sym_lookup((yyvsp[-1].string), 0); |
1316 | sym->flags |= SYMBOL_OPTIONAL; | 1349 | sym->flags |= SYMBOL_OPTIONAL; |
1317 | menu_add_entry(sym); | 1350 | menu_add_entry(sym); |
1318 | printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string); | 1351 | printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string)); |
1319 | ;} | 1352 | ;} |
1320 | break; | 1353 | break; |
1321 | 1354 | ||
@@ -1342,7 +1375,7 @@ yyreduce: | |||
1342 | case 28: | 1375 | case 28: |
1343 | 1376 | ||
1344 | { | 1377 | { |
1345 | menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr); | 1378 | menu_add_expr(P_DEFAULT, (yyvsp[-2].expr), (yyvsp[-1].expr)); |
1346 | menu_set_type(S_TRISTATE); | 1379 | menu_set_type(S_TRISTATE); |
1347 | printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno()); | 1380 | printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno()); |
1348 | ;} | 1381 | ;} |
@@ -1359,7 +1392,7 @@ yyreduce: | |||
1359 | case 30: | 1392 | case 30: |
1360 | 1393 | ||
1361 | { | 1394 | { |
1362 | menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr); | 1395 | menu_add_expr(P_DEFAULT, (yyvsp[-2].expr), (yyvsp[-1].expr)); |
1363 | menu_set_type(S_BOOLEAN); | 1396 | menu_set_type(S_BOOLEAN); |
1364 | printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno()); | 1397 | printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno()); |
1365 | ;} | 1398 | ;} |
@@ -1392,7 +1425,7 @@ yyreduce: | |||
1392 | case 34: | 1425 | case 34: |
1393 | 1426 | ||
1394 | { | 1427 | { |
1395 | menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr); | 1428 | menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr)); |
1396 | printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); | 1429 | printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); |
1397 | ;} | 1430 | ;} |
1398 | break; | 1431 | break; |
@@ -1400,7 +1433,7 @@ yyreduce: | |||
1400 | case 35: | 1433 | case 35: |
1401 | 1434 | ||
1402 | { | 1435 | { |
1403 | menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr); | 1436 | menu_add_expr(P_DEFAULT, (yyvsp[-2].expr), (yyvsp[-1].expr)); |
1404 | printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); | 1437 | printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); |
1405 | ;} | 1438 | ;} |
1406 | break; | 1439 | break; |
@@ -1408,7 +1441,7 @@ yyreduce: | |||
1408 | case 36: | 1441 | case 36: |
1409 | 1442 | ||
1410 | { | 1443 | { |
1411 | menu_add_symbol(P_SELECT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr); | 1444 | menu_add_symbol(P_SELECT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr)); |
1412 | printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno()); | 1445 | printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno()); |
1413 | ;} | 1446 | ;} |
1414 | break; | 1447 | break; |
@@ -1416,7 +1449,7 @@ yyreduce: | |||
1416 | case 37: | 1449 | case 37: |
1417 | 1450 | ||
1418 | { | 1451 | { |
1419 | menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,yyvsp[-3].symbol, yyvsp[-2].symbol), yyvsp[-1].expr); | 1452 | menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[-3].symbol), (yyvsp[-2].symbol)), (yyvsp[-1].expr)); |
1420 | printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); | 1453 | printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); |
1421 | ;} | 1454 | ;} |
1422 | break; | 1455 | break; |
@@ -1443,7 +1476,7 @@ yyreduce: | |||
1443 | case 40: | 1476 | case 40: |
1444 | 1477 | ||
1445 | { | 1478 | { |
1446 | if (zconf_endtoken(yyvsp[0].token, T_CHOICE, T_ENDCHOICE)) { | 1479 | if (zconf_endtoken((yyvsp[0].token), T_CHOICE, T_ENDCHOICE)) { |
1447 | menu_end_menu(); | 1480 | menu_end_menu(); |
1448 | printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno()); | 1481 | printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno()); |
1449 | } | 1482 | } |
@@ -1461,7 +1494,7 @@ yyreduce: | |||
1461 | case 48: | 1494 | case 48: |
1462 | 1495 | ||
1463 | { | 1496 | { |
1464 | menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr); | 1497 | menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr)); |
1465 | printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); | 1498 | printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); |
1466 | ;} | 1499 | ;} |
1467 | break; | 1500 | break; |
@@ -1493,7 +1526,7 @@ yyreduce: | |||
1493 | case 52: | 1526 | case 52: |
1494 | 1527 | ||
1495 | { | 1528 | { |
1496 | menu_add_symbol(P_DEFAULT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr); | 1529 | menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr)); |
1497 | printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); | 1530 | printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); |
1498 | ;} | 1531 | ;} |
1499 | break; | 1532 | break; |
@@ -1503,7 +1536,7 @@ yyreduce: | |||
1503 | { | 1536 | { |
1504 | printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); | 1537 | printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); |
1505 | menu_add_entry(NULL); | 1538 | menu_add_entry(NULL); |
1506 | menu_add_dep(yyvsp[-1].expr); | 1539 | menu_add_dep((yyvsp[-1].expr)); |
1507 | menu_end_entry(); | 1540 | menu_end_entry(); |
1508 | menu_add_menu(); | 1541 | menu_add_menu(); |
1509 | ;} | 1542 | ;} |
@@ -1512,7 +1545,7 @@ yyreduce: | |||
1512 | case 56: | 1545 | case 56: |
1513 | 1546 | ||
1514 | { | 1547 | { |
1515 | if (zconf_endtoken(yyvsp[0].token, T_IF, T_ENDIF)) { | 1548 | if (zconf_endtoken((yyvsp[0].token), T_IF, T_ENDIF)) { |
1516 | menu_end_menu(); | 1549 | menu_end_menu(); |
1517 | printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno()); | 1550 | printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno()); |
1518 | } | 1551 | } |
@@ -1531,7 +1564,7 @@ yyreduce: | |||
1531 | 1564 | ||
1532 | { | 1565 | { |
1533 | menu_add_entry(NULL); | 1566 | menu_add_entry(NULL); |
1534 | menu_add_prompt(P_MENU, yyvsp[-1].string, NULL); | 1567 | menu_add_prompt(P_MENU, (yyvsp[-1].string), NULL); |
1535 | printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); | 1568 | printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); |
1536 | ;} | 1569 | ;} |
1537 | break; | 1570 | break; |
@@ -1547,7 +1580,7 @@ yyreduce: | |||
1547 | case 65: | 1580 | case 65: |
1548 | 1581 | ||
1549 | { | 1582 | { |
1550 | if (zconf_endtoken(yyvsp[0].token, T_MENU, T_ENDMENU)) { | 1583 | if (zconf_endtoken((yyvsp[0].token), T_MENU, T_ENDMENU)) { |
1551 | menu_end_menu(); | 1584 | menu_end_menu(); |
1552 | printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno()); | 1585 | printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno()); |
1553 | } | 1586 | } |
@@ -1570,15 +1603,15 @@ yyreduce: | |||
1570 | case 73: | 1603 | case 73: |
1571 | 1604 | ||
1572 | { | 1605 | { |
1573 | yyval.string = yyvsp[-1].string; | 1606 | (yyval.string) = (yyvsp[-1].string); |
1574 | printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string); | 1607 | printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string)); |
1575 | ;} | 1608 | ;} |
1576 | break; | 1609 | break; |
1577 | 1610 | ||
1578 | case 74: | 1611 | case 74: |
1579 | 1612 | ||
1580 | { | 1613 | { |
1581 | zconf_nextfile(yyvsp[0].string); | 1614 | zconf_nextfile((yyvsp[0].string)); |
1582 | ;} | 1615 | ;} |
1583 | break; | 1616 | break; |
1584 | 1617 | ||
@@ -1586,7 +1619,7 @@ yyreduce: | |||
1586 | 1619 | ||
1587 | { | 1620 | { |
1588 | menu_add_entry(NULL); | 1621 | menu_add_entry(NULL); |
1589 | menu_add_prompt(P_COMMENT, yyvsp[-1].string, NULL); | 1622 | menu_add_prompt(P_COMMENT, (yyvsp[-1].string), NULL); |
1590 | printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); | 1623 | printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); |
1591 | ;} | 1624 | ;} |
1592 | break; | 1625 | break; |
@@ -1609,14 +1642,14 @@ yyreduce: | |||
1609 | case 78: | 1642 | case 78: |
1610 | 1643 | ||
1611 | { | 1644 | { |
1612 | current_entry->sym->help = yyvsp[0].string; | 1645 | current_entry->sym->help = (yyvsp[0].string); |
1613 | ;} | 1646 | ;} |
1614 | break; | 1647 | break; |
1615 | 1648 | ||
1616 | case 82: | 1649 | case 82: |
1617 | 1650 | ||
1618 | { | 1651 | { |
1619 | menu_add_dep(yyvsp[-1].expr); | 1652 | menu_add_dep((yyvsp[-1].expr)); |
1620 | printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); | 1653 | printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); |
1621 | ;} | 1654 | ;} |
1622 | break; | 1655 | break; |
@@ -1624,7 +1657,7 @@ yyreduce: | |||
1624 | case 83: | 1657 | case 83: |
1625 | 1658 | ||
1626 | { | 1659 | { |
1627 | menu_add_dep(yyvsp[-1].expr); | 1660 | menu_add_dep((yyvsp[-1].expr)); |
1628 | printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno()); | 1661 | printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno()); |
1629 | ;} | 1662 | ;} |
1630 | break; | 1663 | break; |
@@ -1632,7 +1665,7 @@ yyreduce: | |||
1632 | case 84: | 1665 | case 84: |
1633 | 1666 | ||
1634 | { | 1667 | { |
1635 | menu_add_dep(yyvsp[-1].expr); | 1668 | menu_add_dep((yyvsp[-1].expr)); |
1636 | printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno()); | 1669 | printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno()); |
1637 | ;} | 1670 | ;} |
1638 | break; | 1671 | break; |
@@ -1640,84 +1673,84 @@ yyreduce: | |||
1640 | case 86: | 1673 | case 86: |
1641 | 1674 | ||
1642 | { | 1675 | { |
1643 | menu_add_prompt(P_PROMPT, yyvsp[-1].string, yyvsp[0].expr); | 1676 | menu_add_prompt(P_PROMPT, (yyvsp[-1].string), (yyvsp[0].expr)); |
1644 | ;} | 1677 | ;} |
1645 | break; | 1678 | break; |
1646 | 1679 | ||
1647 | case 89: | 1680 | case 89: |
1648 | 1681 | ||
1649 | { yyval.token = T_ENDMENU; ;} | 1682 | { (yyval.token) = T_ENDMENU; ;} |
1650 | break; | 1683 | break; |
1651 | 1684 | ||
1652 | case 90: | 1685 | case 90: |
1653 | 1686 | ||
1654 | { yyval.token = T_ENDCHOICE; ;} | 1687 | { (yyval.token) = T_ENDCHOICE; ;} |
1655 | break; | 1688 | break; |
1656 | 1689 | ||
1657 | case 91: | 1690 | case 91: |
1658 | 1691 | ||
1659 | { yyval.token = T_ENDIF; ;} | 1692 | { (yyval.token) = T_ENDIF; ;} |
1660 | break; | 1693 | break; |
1661 | 1694 | ||
1662 | case 94: | 1695 | case 94: |
1663 | 1696 | ||
1664 | { yyval.expr = NULL; ;} | 1697 | { (yyval.expr) = NULL; ;} |
1665 | break; | 1698 | break; |
1666 | 1699 | ||
1667 | case 95: | 1700 | case 95: |
1668 | 1701 | ||
1669 | { yyval.expr = yyvsp[0].expr; ;} | 1702 | { (yyval.expr) = (yyvsp[0].expr); ;} |
1670 | break; | 1703 | break; |
1671 | 1704 | ||
1672 | case 96: | 1705 | case 96: |
1673 | 1706 | ||
1674 | { yyval.expr = expr_alloc_symbol(yyvsp[0].symbol); ;} | 1707 | { (yyval.expr) = expr_alloc_symbol((yyvsp[0].symbol)); ;} |
1675 | break; | 1708 | break; |
1676 | 1709 | ||
1677 | case 97: | 1710 | case 97: |
1678 | 1711 | ||
1679 | { yyval.expr = expr_alloc_comp(E_EQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;} | 1712 | { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); ;} |
1680 | break; | 1713 | break; |
1681 | 1714 | ||
1682 | case 98: | 1715 | case 98: |
1683 | 1716 | ||
1684 | { yyval.expr = expr_alloc_comp(E_UNEQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;} | 1717 | { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); ;} |
1685 | break; | 1718 | break; |
1686 | 1719 | ||
1687 | case 99: | 1720 | case 99: |
1688 | 1721 | ||
1689 | { yyval.expr = yyvsp[-1].expr; ;} | 1722 | { (yyval.expr) = (yyvsp[-1].expr); ;} |
1690 | break; | 1723 | break; |
1691 | 1724 | ||
1692 | case 100: | 1725 | case 100: |
1693 | 1726 | ||
1694 | { yyval.expr = expr_alloc_one(E_NOT, yyvsp[0].expr); ;} | 1727 | { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[0].expr)); ;} |
1695 | break; | 1728 | break; |
1696 | 1729 | ||
1697 | case 101: | 1730 | case 101: |
1698 | 1731 | ||
1699 | { yyval.expr = expr_alloc_two(E_OR, yyvsp[-2].expr, yyvsp[0].expr); ;} | 1732 | { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[-2].expr), (yyvsp[0].expr)); ;} |
1700 | break; | 1733 | break; |
1701 | 1734 | ||
1702 | case 102: | 1735 | case 102: |
1703 | 1736 | ||
1704 | { yyval.expr = expr_alloc_two(E_AND, yyvsp[-2].expr, yyvsp[0].expr); ;} | 1737 | { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); ;} |
1705 | break; | 1738 | break; |
1706 | 1739 | ||
1707 | case 103: | 1740 | case 103: |
1708 | 1741 | ||
1709 | { yyval.symbol = sym_lookup(yyvsp[0].string, 0); free(yyvsp[0].string); ;} | 1742 | { (yyval.symbol) = sym_lookup((yyvsp[0].string), 0); free((yyvsp[0].string)); ;} |
1710 | break; | 1743 | break; |
1711 | 1744 | ||
1712 | case 104: | 1745 | case 104: |
1713 | 1746 | ||
1714 | { yyval.symbol = sym_lookup(yyvsp[0].string, 1); free(yyvsp[0].string); ;} | 1747 | { (yyval.symbol) = sym_lookup((yyvsp[0].string), 1); free((yyvsp[0].string)); ;} |
1715 | break; | 1748 | break; |
1716 | 1749 | ||
1717 | 1750 | ||
1718 | } | 1751 | } |
1719 | 1752 | ||
1720 | /* Line 999 of yacc.c. */ | 1753 | /* Line 1037 of yacc.c. */ |
1721 | 1754 | ||
1722 | 1755 | ||
1723 | yyvsp -= yylen; | 1756 | yyvsp -= yylen; |
@@ -1759,18 +1792,33 @@ yyerrlab: | |||
1759 | { | 1792 | { |
1760 | YYSIZE_T yysize = 0; | 1793 | YYSIZE_T yysize = 0; |
1761 | int yytype = YYTRANSLATE (yychar); | 1794 | int yytype = YYTRANSLATE (yychar); |
1795 | const char* yyprefix; | ||
1762 | char *yymsg; | 1796 | char *yymsg; |
1763 | int yyx, yycount; | 1797 | int yyx; |
1764 | 1798 | ||
1765 | yycount = 0; | ||
1766 | /* Start YYX at -YYN if negative to avoid negative indexes in | 1799 | /* Start YYX at -YYN if negative to avoid negative indexes in |
1767 | YYCHECK. */ | 1800 | YYCHECK. */ |
1768 | for (yyx = yyn < 0 ? -yyn : 0; | 1801 | int yyxbegin = yyn < 0 ? -yyn : 0; |
1769 | yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) | 1802 | |
1803 | /* Stay within bounds of both yycheck and yytname. */ | ||
1804 | int yychecklim = YYLAST - yyn; | ||
1805 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; | ||
1806 | int yycount = 0; | ||
1807 | |||
1808 | yyprefix = ", expecting "; | ||
1809 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) | ||
1770 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) | 1810 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) |
1771 | yysize += yystrlen (yytname[yyx]) + 15, yycount++; | 1811 | { |
1772 | yysize += yystrlen ("syntax error, unexpected ") + 1; | 1812 | yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); |
1773 | yysize += yystrlen (yytname[yytype]); | 1813 | yycount += 1; |
1814 | if (yycount == 5) | ||
1815 | { | ||
1816 | yysize = 0; | ||
1817 | break; | ||
1818 | } | ||
1819 | } | ||
1820 | yysize += (sizeof ("syntax error, unexpected ") | ||
1821 | + yystrlen (yytname[yytype])); | ||
1774 | yymsg = (char *) YYSTACK_ALLOC (yysize); | 1822 | yymsg = (char *) YYSTACK_ALLOC (yysize); |
1775 | if (yymsg != 0) | 1823 | if (yymsg != 0) |
1776 | { | 1824 | { |
@@ -1779,16 +1827,13 @@ yyerrlab: | |||
1779 | 1827 | ||
1780 | if (yycount < 5) | 1828 | if (yycount < 5) |
1781 | { | 1829 | { |
1782 | yycount = 0; | 1830 | yyprefix = ", expecting "; |
1783 | for (yyx = yyn < 0 ? -yyn : 0; | 1831 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
1784 | yyx < (int) (sizeof (yytname) / sizeof (char *)); | ||
1785 | yyx++) | ||
1786 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) | 1832 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) |
1787 | { | 1833 | { |
1788 | const char *yyq = ! yycount ? ", expecting " : " or "; | 1834 | yyp = yystpcpy (yyp, yyprefix); |
1789 | yyp = yystpcpy (yyp, yyq); | ||
1790 | yyp = yystpcpy (yyp, yytname[yyx]); | 1835 | yyp = yystpcpy (yyp, yytname[yyx]); |
1791 | yycount++; | 1836 | yyprefix = " or "; |
1792 | } | 1837 | } |
1793 | } | 1838 | } |
1794 | yyerror (yymsg); | 1839 | yyerror (yymsg); |
@@ -1806,38 +1851,57 @@ yyerrlab: | |||
1806 | 1851 | ||
1807 | if (yyerrstatus == 3) | 1852 | if (yyerrstatus == 3) |
1808 | { | 1853 | { |
1809 | /* If just tried and failed to reuse lookahead token after an | 1854 | /* If just tried and failed to reuse look-ahead token after an |
1810 | error, discard it. */ | 1855 | error, discard it. */ |
1811 | 1856 | ||
1812 | /* Return failure if at end of input. */ | 1857 | if (yychar <= YYEOF) |
1813 | if (yychar == YYEOF) | ||
1814 | { | 1858 | { |
1815 | /* Pop the error token. */ | 1859 | /* If at end of input, pop the error token, |
1816 | YYPOPSTACK; | 1860 | then the rest of the stack, then return failure. */ |
1817 | /* Pop the rest of the stack. */ | 1861 | if (yychar == YYEOF) |
1818 | while (yyss < yyssp) | 1862 | for (;;) |
1819 | { | 1863 | { |
1820 | YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); | 1864 | |
1821 | yydestruct (yystos[*yyssp], yyvsp); | 1865 | YYPOPSTACK; |
1822 | YYPOPSTACK; | 1866 | if (yyssp == yyss) |
1823 | } | 1867 | YYABORT; |
1824 | YYABORT; | 1868 | yydestruct ("Error: popping", |
1869 | yystos[*yyssp], yyvsp); | ||
1870 | } | ||
1825 | } | 1871 | } |
1826 | 1872 | else | |
1827 | YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); | 1873 | { |
1828 | yydestruct (yytoken, &yylval); | 1874 | yydestruct ("Error: discarding", yytoken, &yylval); |
1829 | yychar = YYEMPTY; | 1875 | yychar = YYEMPTY; |
1830 | 1876 | } | |
1831 | } | 1877 | } |
1832 | 1878 | ||
1833 | /* Else will try to reuse lookahead token after shifting the error | 1879 | /* Else will try to reuse look-ahead token after shifting the error |
1834 | token. */ | 1880 | token. */ |
1835 | goto yyerrlab1; | 1881 | goto yyerrlab1; |
1836 | 1882 | ||
1837 | 1883 | ||
1838 | /*----------------------------------------------------. | 1884 | /*---------------------------------------------------. |
1839 | | yyerrlab1 -- error raised explicitly by an action. | | 1885 | | yyerrorlab -- error raised explicitly by YYERROR. | |
1840 | `----------------------------------------------------*/ | 1886 | `---------------------------------------------------*/ |
1887 | yyerrorlab: | ||
1888 | |||
1889 | #ifdef __GNUC__ | ||
1890 | /* Pacify GCC when the user code never invokes YYERROR and the label | ||
1891 | yyerrorlab therefore never appears in user code. */ | ||
1892 | if (0) | ||
1893 | goto yyerrorlab; | ||
1894 | #endif | ||
1895 | |||
1896 | yyvsp -= yylen; | ||
1897 | yyssp -= yylen; | ||
1898 | yystate = *yyssp; | ||
1899 | goto yyerrlab1; | ||
1900 | |||
1901 | |||
1902 | /*-------------------------------------------------------------. | ||
1903 | | yyerrlab1 -- common code for both syntax error and YYERROR. | | ||
1904 | `-------------------------------------------------------------*/ | ||
1841 | yyerrlab1: | 1905 | yyerrlab1: |
1842 | yyerrstatus = 3; /* Each real token shifted decrements this. */ | 1906 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
1843 | 1907 | ||
@@ -1859,22 +1923,22 @@ yyerrlab1: | |||
1859 | if (yyssp == yyss) | 1923 | if (yyssp == yyss) |
1860 | YYABORT; | 1924 | YYABORT; |
1861 | 1925 | ||
1862 | YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); | ||
1863 | yydestruct (yystos[yystate], yyvsp); | ||
1864 | yyvsp--; | ||
1865 | yystate = *--yyssp; | ||
1866 | 1926 | ||
1927 | yydestruct ("Error: popping", yystos[yystate], yyvsp); | ||
1928 | YYPOPSTACK; | ||
1929 | yystate = *yyssp; | ||
1867 | YY_STACK_PRINT (yyss, yyssp); | 1930 | YY_STACK_PRINT (yyss, yyssp); |
1868 | } | 1931 | } |
1869 | 1932 | ||
1870 | if (yyn == YYFINAL) | 1933 | if (yyn == YYFINAL) |
1871 | YYACCEPT; | 1934 | YYACCEPT; |
1872 | 1935 | ||
1873 | YYDPRINTF ((stderr, "Shifting error token, ")); | ||
1874 | |||
1875 | *++yyvsp = yylval; | 1936 | *++yyvsp = yylval; |
1876 | 1937 | ||
1877 | 1938 | ||
1939 | /* Shift the error token. */ | ||
1940 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); | ||
1941 | |||
1878 | yystate = yyn; | 1942 | yystate = yyn; |
1879 | goto yynewstate; | 1943 | goto yynewstate; |
1880 | 1944 | ||
@@ -1890,6 +1954,9 @@ yyacceptlab: | |||
1890 | | yyabortlab -- YYABORT comes here. | | 1954 | | yyabortlab -- YYABORT comes here. | |
1891 | `-----------------------------------*/ | 1955 | `-----------------------------------*/ |
1892 | yyabortlab: | 1956 | yyabortlab: |
1957 | yydestruct ("Error: discarding lookahead", | ||
1958 | yytoken, &yylval); | ||
1959 | yychar = YYEMPTY; | ||
1893 | yyresult = 1; | 1960 | yyresult = 1; |
1894 | goto yyreturn; | 1961 | goto yyreturn; |
1895 | 1962 | ||