diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2006-06-09 01:12:44 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-06-09 01:31:30 -0400 |
commit | f6a88aa86027bdecfc74ef7c6bf6c68233e86bb3 (patch) | |
tree | 524a366add362ffae3fa550fd822293ffd84984e /scripts/kconfig/zconf.y | |
parent | f1d28fb043b325dad8944647a52b20287e59d8a1 (diff) |
kconfig: add symbol option config syntax
This adds the general framework to the parser to define options for config
symbols with a syntax like:
config FOO
option bar[="arg"]
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig/zconf.y')
-rw-r--r-- | scripts/kconfig/zconf.y | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 1f61fba6aa28..9d08582f2aa6 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y | |||
@@ -71,6 +71,7 @@ static struct menu *current_menu, *current_entry; | |||
71 | %token <id>T_DEFAULT | 71 | %token <id>T_DEFAULT |
72 | %token <id>T_SELECT | 72 | %token <id>T_SELECT |
73 | %token <id>T_RANGE | 73 | %token <id>T_RANGE |
74 | %token <id>T_OPTION | ||
74 | %token <id>T_ON | 75 | %token <id>T_ON |
75 | %token <string> T_WORD | 76 | %token <string> T_WORD |
76 | %token <string> T_WORD_QUOTE | 77 | %token <string> T_WORD_QUOTE |
@@ -91,6 +92,7 @@ static struct menu *current_menu, *current_entry; | |||
91 | %type <id> end | 92 | %type <id> end |
92 | %type <id> option_name | 93 | %type <id> option_name |
93 | %type <menu> if_entry menu_entry choice_entry | 94 | %type <menu> if_entry menu_entry choice_entry |
95 | %type <string> symbol_option_arg | ||
94 | 96 | ||
95 | %destructor { | 97 | %destructor { |
96 | fprintf(stderr, "%s:%d: missing end statement for this entry\n", | 98 | fprintf(stderr, "%s:%d: missing end statement for this entry\n", |
@@ -173,6 +175,7 @@ menuconfig_stmt: menuconfig_entry_start config_option_list | |||
173 | config_option_list: | 175 | config_option_list: |
174 | /* empty */ | 176 | /* empty */ |
175 | | config_option_list config_option | 177 | | config_option_list config_option |
178 | | config_option_list symbol_option | ||
176 | | config_option_list depends | 179 | | config_option_list depends |
177 | | config_option_list help | 180 | | config_option_list help |
178 | | config_option_list option_error | 181 | | config_option_list option_error |
@@ -215,6 +218,26 @@ config_option: T_RANGE symbol symbol if_expr T_EOL | |||
215 | printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); | 218 | printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); |
216 | }; | 219 | }; |
217 | 220 | ||
221 | symbol_option: T_OPTION symbol_option_list T_EOL | ||
222 | ; | ||
223 | |||
224 | symbol_option_list: | ||
225 | /* empty */ | ||
226 | | symbol_option_list T_WORD symbol_option_arg | ||
227 | { | ||
228 | struct kconf_id *id = kconf_id_lookup($2, strlen($2)); | ||
229 | if (id && id->flags & TF_OPTION) | ||
230 | menu_add_option(id->token, $3); | ||
231 | else | ||
232 | zconfprint("warning: ignoring unknown option %s", $2); | ||
233 | free($2); | ||
234 | }; | ||
235 | |||
236 | symbol_option_arg: | ||
237 | /* empty */ { $$ = NULL; } | ||
238 | | T_EQUAL prompt { $$ = $2; } | ||
239 | ; | ||
240 | |||
218 | /* choice entry */ | 241 | /* choice entry */ |
219 | 242 | ||
220 | choice: T_CHOICE T_EOL | 243 | choice: T_CHOICE T_EOL |