1
2enum token {
3 tok_menuname,
4 tok_menuoption,
5 tok_comment,
6 tok_bool,
7 tok_tristate,
8 tok_dep_tristate,
9 tok_nop,
10 tok_if,
11 tok_else,
12 tok_fi,
13 tok_int,
14 tok_hex,
15 tok_string,
16 tok_make,
17 tok_define,
18 tok_choose,
19 tok_choice,
20 tok_endmenu,
21 tok_unknown
22};
23
24enum operator {
25 op_eq,
26 op_neq,
27 op_and,
28 op_and1,
29 op_or,
30 op_bang,
31 op_lparen,
32 op_rparen,
33 op_variable,
34 op_kvariable,
35 op_shellcmd,
36 op_constant,
37 op_nuked
38};
39
40union var
41{
42 char * str;
43 struct kconfig * cfg;
44};
45
46struct condition
47{
48 struct condition * next;
49 enum operator op;
50 union var variable;
51};
52
53#define GLOBAL_WRITTEN 1
54#define CFG_DUP 2
55#define UNSAFE 4
56
57struct kconfig
58{
59 struct kconfig * next;
60 int flags;
61 enum token tok;
62 char menu_number;
63 char menu_line;
64 char submenu_start;
65 char submenu_end;
66 char * optionname;
67 char * label;
68 char * value;
69 int choice_value;
70 struct kconfig * choice_label;
71 union var depend;
72 struct condition * cond;
73};
74
75extern struct kconfig * config;
76extern struct kconfig * clast;
77extern struct kconfig * koption;
78
79
80
81
82void fix_conditionals(struct kconfig * scfg);
83void dump_tk_script(struct kconfig *scfg);
84