Import 2.2.8pre4
[davej-history.git] / scripts / tkparse.h
blob0478effedabd24582eb09758ce9f974c192f443d
1 /*
2 * tkparse.h
3 */
5 /*
6 * Token types (mostly statement types).
7 */
9 enum e_token
11 token_UNKNOWN,
12 token_bool,
13 token_choice_header,
14 token_choice_item,
15 token_comment,
16 token_define_bool,
17 token_dep_tristate,
18 token_else,
19 token_endmenu,
20 token_fi,
21 token_hex,
22 token_if,
23 token_int,
24 token_mainmenu_name,
25 token_mainmenu_option,
26 token_source,
27 token_string,
28 token_then,
29 token_tristate,
30 token_unset,
34 * Operator types for conditionals.
37 enum operator
39 op_eq,
40 op_neq,
41 op_and,
42 op_and1,
43 op_or,
44 op_bang,
45 op_lparen,
46 op_rparen,
47 op_constant,
48 op_variable,
49 op_kvariable,
50 op_nuked
54 * Conditions come in linked lists.
55 * Some operators take strings:
57 * op_constant "foo"
58 * op_variable "$ARCH", "$CONFIG_PMAC"
59 * op_kvariable "$CONFIG_EXPERIMENTAL"
61 * Most "$..." constructs refer to a variable which is defined somewhere
62 * in the script, so they become op_kvariable's instead. Note that it
63 * is legal to test variables which are never defined, such as variables
64 * that are meaningful only on other architectures.
67 struct condition
69 struct condition * next;
70 enum operator op;
71 const char * str; /* op_constant, op_variable */
72 struct kconfig * cfg; /* op_kvariable */
76 * A statement from a config.in file
79 struct kconfig
81 struct kconfig * next;
82 enum e_token token;
83 char * optionname;
84 char * label;
85 char * value;
86 struct condition * cond;
87 char * depend; /* token_dep_tristate */
88 struct kconfig * cfg_parent; /* token_choice_item */
90 /* used only in tkgen.c */
91 char global_written;
92 int menu_number;
93 int menu_line;
94 struct kconfig * menu_next;
100 * Prototypes
103 extern void fix_conditionals ( struct kconfig * scfg ); /* tkcond.c */
104 extern void dump_tk_script ( struct kconfig * scfg ); /* tkgen.c */