aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/zconf.y
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/zconf.y')
-rw-r--r--scripts/kconfig/zconf.y19
1 files changed, 5 insertions, 14 deletions
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 49fb4ab664c..864da07ba4a 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -11,7 +11,6 @@
11#include <string.h> 11#include <string.h>
12#include <stdbool.h> 12#include <stdbool.h>
13 13
14#define LKC_DIRECT_LINK
15#include "lkc.h" 14#include "lkc.h"
16 15
17#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) 16#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
@@ -25,16 +24,12 @@ extern int zconflex(void);
25static void zconfprint(const char *err, ...); 24static void zconfprint(const char *err, ...);
26static void zconf_error(const char *err, ...); 25static void zconf_error(const char *err, ...);
27static void zconferror(const char *err); 26static void zconferror(const char *err);
28static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken); 27static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
29 28
30struct symbol *symbol_hash[SYMBOL_HASHSIZE]; 29struct symbol *symbol_hash[SYMBOL_HASHSIZE];
31 30
32static struct menu *current_menu, *current_entry; 31static struct menu *current_menu, *current_entry;
33 32
34#define YYDEBUG 0
35#if YYDEBUG
36#define YYERROR_VERBOSE
37#endif
38%} 33%}
39%expect 30 34%expect 30
40 35
@@ -45,7 +40,7 @@ static struct menu *current_menu, *current_entry;
45 struct symbol *symbol; 40 struct symbol *symbol;
46 struct expr *expr; 41 struct expr *expr;
47 struct menu *menu; 42 struct menu *menu;
48 struct kconf_id *id; 43 const struct kconf_id *id;
49} 44}
50 45
51%token <id>T_MAINMENU 46%token <id>T_MAINMENU
@@ -229,7 +224,7 @@ symbol_option_list:
229 /* empty */ 224 /* empty */
230 | symbol_option_list T_WORD symbol_option_arg 225 | symbol_option_list T_WORD symbol_option_arg
231{ 226{
232 struct kconf_id *id = kconf_id_lookup($2, strlen($2)); 227 const struct kconf_id *id = kconf_id_lookup($2, strlen($2));
233 if (id && id->flags & TF_OPTION) 228 if (id && id->flags & TF_OPTION)
234 menu_add_option(id->token, $3); 229 menu_add_option(id->token, $3);
235 else 230 else
@@ -503,10 +498,8 @@ void conf_parse(const char *name)
503 modules_sym->flags |= SYMBOL_AUTO; 498 modules_sym->flags |= SYMBOL_AUTO;
504 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); 499 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
505 500
506#if YYDEBUG
507 if (getenv("ZCONF_DEBUG")) 501 if (getenv("ZCONF_DEBUG"))
508 zconfdebug = 1; 502 zconfdebug = 1;
509#endif
510 zconfparse(); 503 zconfparse();
511 if (zconfnerrs) 504 if (zconfnerrs)
512 exit(1); 505 exit(1);
@@ -545,7 +538,7 @@ static const char *zconf_tokenname(int token)
545 return "<token>"; 538 return "<token>";
546} 539}
547 540
548static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken) 541static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken)
549{ 542{
550 if (id->token != endtoken) { 543 if (id->token != endtoken) {
551 zconf_error("unexpected '%s' within %s block", 544 zconf_error("unexpected '%s' within %s block",
@@ -590,9 +583,7 @@ static void zconf_error(const char *err, ...)
590 583
591static void zconferror(const char *err) 584static void zconferror(const char *err)
592{ 585{
593#if YYDEBUG
594 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err); 586 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
595#endif
596} 587}
597 588
598static void print_quoted_string(FILE *out, const char *str) 589static void print_quoted_string(FILE *out, const char *str)
@@ -741,7 +732,7 @@ void zconfdump(FILE *out)
741 } 732 }
742} 733}
743 734
744#include "lex.zconf.c" 735#include "zconf.lex.c"
745#include "util.c" 736#include "util.c"
746#include "confdata.c" 737#include "confdata.c"
747#include "expr.c" 738#include "expr.c"