2.2.0-final
[davej-history.git] / scripts / tkparse.h
blobe2bca1950393ca1cc27e993befae7fb85b62fe62
1 /*
2 * tkparse.h
3 */
5 /*
6 * Define this symbol to generate exactly the same output, byte for byte,
7 * as the previous version of xconfig. I need to do this to make sure I
8 * I don't break anything in my moby edit. -- mec
9 */
11 #define BUG_COMPATIBLE
14 * Token types (mostly statement types).
17 enum e_token
19 token_UNKNOWN,
20 token_bool,
21 token_choice_header,
22 token_choice_item,
23 token_comment,
24 token_define_bool,
25 token_dep_tristate,
26 token_else,
27 token_endmenu,
28 token_fi,
29 token_hex,
30 token_if,
31 token_int,
32 token_mainmenu_name,
33 token_mainmenu_option,
34 token_source,
35 token_string,
36 token_then,
37 token_tristate,
38 token_unset,
42 * Operator types for conditionals.
45 enum operator
47 op_eq,
48 op_neq,
49 op_and,
50 op_and1,
51 op_or,
52 op_bang,
53 op_lparen,
54 op_rparen,
55 op_constant,
56 op_variable,
57 op_kvariable,
58 op_nuked
62 * Conditions come in linked lists.
63 * Some operators take strings:
65 * op_constant "foo"
66 * op_variable "$ARCH", "$CONFIG_PMAC"
67 * op_kvariable "$CONFIG_EXPERIMENTAL"
69 * Most "$..." constructs refer to a variable which is defined somewhere
70 * in the script, so they become op_kvariable's instead. Note that it
71 * is legal to test variables which are never defined, such as variables
72 * that are meaningful only on other architectures.
75 struct condition
77 struct condition * next;
78 enum operator op;
79 const char * str; /* op_constant, op_variable */
80 struct kconfig * cfg; /* op_kvariable */
84 * A statement from a config.in file
87 struct kconfig
89 struct kconfig * next;
90 enum e_token token;
91 char * optionname;
92 char * label;
93 char * value;
94 struct condition * cond;
95 char * depend; /* token_dep_tristate */
96 struct kconfig * cfg_parent; /* token_choice_item */
98 /* used only in tkgen.c */
99 char global_written;
100 int menu_number;
101 int menu_line;
102 struct kconfig * menu_next;
108 * Prototypes
111 extern void fix_conditionals ( struct kconfig * scfg ); /* tkcond.c */
112 extern void dump_tk_script ( struct kconfig * scfg ); /* tkgen.c */