kconfig: explicitly introduce expression list

Rename E_CHOICE to E_LIST to explicitly add support for expression
lists. Add a helper macro expr_list_for_each_sym to more easily iterate
over the list.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
This commit is contained in:
Roman Zippel
2008-01-14 04:50:23 +01:00
committed by Sam Ravnborg
parent 0ffce8d944
commit 7a96292335
5 changed files with 24 additions and 20 deletions

View File

@ -87,7 +87,7 @@ struct expr *expr_copy(struct expr *org)
break;
case E_AND:
case E_OR:
case E_CHOICE:
case E_LIST:
e->left.expr = expr_copy(org->left.expr);
e->right.expr = expr_copy(org->right.expr);
break;
@ -217,7 +217,7 @@ int expr_eq(struct expr *e1, struct expr *e2)
expr_free(e2);
trans_count = old_count;
return res;
case E_CHOICE:
case E_LIST:
case E_RANGE:
case E_NONE:
/* panic */;
@ -648,7 +648,7 @@ struct expr *expr_transform(struct expr *e)
case E_EQUAL:
case E_UNEQUAL:
case E_SYMBOL:
case E_CHOICE:
case E_LIST:
break;
default:
e->left.expr = expr_transform(e->left.expr);
@ -932,7 +932,7 @@ struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symb
break;
case E_SYMBOL:
return expr_alloc_comp(type, e->left.sym, sym);
case E_CHOICE:
case E_LIST:
case E_RANGE:
case E_NONE:
/* panic */;
@ -1000,9 +1000,9 @@ int expr_compare_type(enum expr_type t1, enum expr_type t2)
if (t2 == E_OR)
return 1;
case E_OR:
if (t2 == E_CHOICE)
if (t2 == E_LIST)
return 1;
case E_CHOICE:
case E_LIST:
if (t2 == 0)
return 1;
default:
@ -1053,11 +1053,11 @@ void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *
fn(data, NULL, " && ");
expr_print(e->right.expr, fn, data, E_AND);
break;
case E_CHOICE:
case E_LIST:
fn(data, e->right.sym, e->right.sym->name);
if (e->left.expr) {
fn(data, NULL, " ^ ");
expr_print(e->left.expr, fn, data, E_CHOICE);
expr_print(e->left.expr, fn, data, E_LIST);
}
break;
case E_RANGE: