diff options
author | Arnaud Lacombe <lacombar@gmail.com> | 2010-11-06 18:30:23 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-11-22 11:27:17 -0200 |
commit | 86e187ff9bce9fbed7bfed92ae34f491cf1af50f (patch) | |
tree | d857b2671a98e2eb1ddc80477b564e4d279ae464 /scripts/kconfig/zconf.y | |
parent | e53beacd23d9cb47590da6a7a7f6d417b941a994 (diff) | |
download | op-kernel-dev-86e187ff9bce9fbed7bfed92ae34f491cf1af50f.zip op-kernel-dev-86e187ff9bce9fbed7bfed92ae34f491cf1af50f.tar.gz |
kconfig: add an option to determine a menu's visibility
This option is aimed to add the possibility to control a menu's visibility
without adding dependency to the expression to all the submenu.
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'scripts/kconfig/zconf.y')
-rw-r--r-- | scripts/kconfig/zconf.y | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 2abd3c7..49fb4ab 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -36,7 +36,7 @@ static struct menu *current_menu, *current_entry; #define YYERROR_VERBOSE #endif %} -%expect 28 +%expect 30 %union { @@ -68,6 +68,7 @@ static struct menu *current_menu, *current_entry; %token <id>T_DEFAULT %token <id>T_SELECT %token <id>T_RANGE +%token <id>T_VISIBLE %token <id>T_OPTION %token <id>T_ON %token <string> T_WORD @@ -123,7 +124,7 @@ stmt_list: ; option_name: - T_DEPENDS | T_PROMPT | T_TYPE | T_SELECT | T_OPTIONAL | T_RANGE | T_DEFAULT + T_DEPENDS | T_PROMPT | T_TYPE | T_SELECT | T_OPTIONAL | T_RANGE | T_DEFAULT | T_VISIBLE ; common_stmt: @@ -359,7 +360,7 @@ menu: T_MENU prompt T_EOL printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); }; -menu_entry: menu depends_list +menu_entry: menu visibility_list depends_list { $$ = menu_add_menu(); }; @@ -430,6 +431,19 @@ depends: T_DEPENDS T_ON expr T_EOL printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); }; +/* visibility option */ + +visibility_list: + /* empty */ + | visibility_list visible + | visibility_list T_EOL +; + +visible: T_VISIBLE if_expr +{ + menu_add_visibility($2); +}; + /* prompt statement */ prompt_stmt_opt: @@ -526,6 +540,7 @@ static const char *zconf_tokenname(int token) case T_IF: return "if"; case T_ENDIF: return "endif"; case T_DEPENDS: return "depends"; + case T_VISIBLE: return "visible"; } return "<token>"; } |