aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2005-11-09 00:34:52 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 10:55:54 -0500
commit3370f9f0d9c7d14bf71aab27fa45c0537f130614 (patch)
treed1fb9b98aabf5fb6dd4e68c1dc69eb345f0c7f60 /scripts/kconfig
parent7a88488bbc231e48a4a88ee2569bc0cc5d706f0a (diff)
[PATCH] kconfig: simplify symbol type parsing
This simplifies the parser a bit by merging the various symbol types into a single token and adds the type to the keyword hash. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/lex.zconf.c_shipped5
-rw-r--r--scripts/kconfig/lkc.h1
-rw-r--r--scripts/kconfig/zconf.gperf20
-rw-r--r--scripts/kconfig/zconf.hash.c_shipped20
-rw-r--r--scripts/kconfig/zconf.l5
-rw-r--r--scripts/kconfig/zconf.tab.c_shipped608
-rw-r--r--scripts/kconfig/zconf.y130
7 files changed, 342 insertions, 447 deletions
diff --git a/scripts/kconfig/lex.zconf.c_shipped b/scripts/kconfig/lex.zconf.c_shipped
index 0168141417f6..bedba89a87c6 100644
--- a/scripts/kconfig/lex.zconf.c_shipped
+++ b/scripts/kconfig/lex.zconf.c_shipped
@@ -1025,6 +1025,7 @@ YY_RULE_SETUP
1025 struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng); 1025 struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
1026 if (id && id->flags & TF_COMMAND) { 1026 if (id && id->flags & TF_COMMAND) {
1027 BEGIN(PARAM); 1027 BEGIN(PARAM);
1028 zconflval.id = id;
1028 return id->token; 1029 return id->token;
1029 } 1030 }
1030 alloc_string(zconftext, zconfleng); 1031 alloc_string(zconftext, zconfleng);
@@ -1091,8 +1092,10 @@ case 19:
1091YY_RULE_SETUP 1092YY_RULE_SETUP
1092{ 1093{
1093 struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng); 1094 struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
1094 if (id && id->flags & TF_PARAM) 1095 if (id && id->flags & TF_PARAM) {
1096 zconflval.id = id;
1095 return id->token; 1097 return id->token;
1098 }
1096 alloc_string(zconftext, zconfleng); 1099 alloc_string(zconftext, zconfleng);
1097 zconflval.string = text; 1100 zconflval.string = text;
1098 return T_WORD; 1101 return T_WORD;
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 6881fb084324..91491d0a3029 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -45,6 +45,7 @@ struct kconf_id {
45 int name; 45 int name;
46 int token; 46 int token;
47 unsigned int flags; 47 unsigned int flags;
48 enum symbol_type stype;
48}; 49};
49 50
50int zconfparse(void); 51int zconfparse(void);
diff --git a/scripts/kconfig/zconf.gperf b/scripts/kconfig/zconf.gperf
index c9d81cf5d7fb..b03220600b3a 100644
--- a/scripts/kconfig/zconf.gperf
+++ b/scripts/kconfig/zconf.gperf
@@ -25,17 +25,17 @@ endif, T_ENDIF, TF_COMMAND
25depends, T_DEPENDS, TF_COMMAND 25depends, T_DEPENDS, TF_COMMAND
26requires, T_REQUIRES, TF_COMMAND 26requires, T_REQUIRES, TF_COMMAND
27optional, T_OPTIONAL, TF_COMMAND 27optional, T_OPTIONAL, TF_COMMAND
28default, T_DEFAULT, TF_COMMAND 28default, T_DEFAULT, TF_COMMAND, S_UNKNOWN
29prompt, T_PROMPT, TF_COMMAND 29prompt, T_PROMPT, TF_COMMAND
30tristate, T_TRISTATE, TF_COMMAND 30tristate, T_TYPE, TF_COMMAND, S_TRISTATE
31def_tristate, T_DEF_TRISTATE, TF_COMMAND 31def_tristate, T_DEFAULT, TF_COMMAND, S_TRISTATE
32bool, T_BOOLEAN, TF_COMMAND 32bool, T_TYPE, TF_COMMAND, S_BOOLEAN
33boolean, T_BOOLEAN, TF_COMMAND 33boolean, T_TYPE, TF_COMMAND, S_BOOLEAN
34def_bool, T_DEF_BOOLEAN, TF_COMMAND 34def_bool, T_DEFAULT, TF_COMMAND, S_BOOLEAN
35def_boolean, T_DEF_BOOLEAN, TF_COMMAND 35def_boolean, T_DEFAULT, TF_COMMAND, S_BOOLEAN
36int, T_INT, TF_COMMAND 36int, T_TYPE, TF_COMMAND, S_INT
37hex, T_HEX, TF_COMMAND 37hex, T_TYPE, TF_COMMAND, S_HEX
38string, T_STRING, TF_COMMAND 38string, T_TYPE, TF_COMMAND, S_STRING
39select, T_SELECT, TF_COMMAND 39select, T_SELECT, TF_COMMAND
40enable, T_SELECT, TF_COMMAND 40enable, T_SELECT, TF_COMMAND
41range, T_RANGE, TF_COMMAND 41range, T_RANGE, TF_COMMAND
diff --git a/scripts/kconfig/zconf.hash.c_shipped b/scripts/kconfig/zconf.hash.c_shipped
index 6741cb159801..345f0fc07ca3 100644
--- a/scripts/kconfig/zconf.hash.c_shipped
+++ b/scripts/kconfig/zconf.hash.c_shipped
@@ -172,27 +172,27 @@ kconf_id_lookup (register const char *str, register unsigned int len)
172 { 172 {
173 {-1}, {-1}, 173 {-1}, {-1},
174 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_IF, TF_COMMAND|TF_PARAM}, 174 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_IF, TF_COMMAND|TF_PARAM},
175 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_INT, TF_COMMAND}, 175 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_TYPE, TF_COMMAND, S_INT},
176 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str4, T_HELP, TF_COMMAND}, 176 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str4, T_HELP, TF_COMMAND},
177 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5, T_ENDIF, TF_COMMAND}, 177 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5, T_ENDIF, TF_COMMAND},
178 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6, T_SELECT, TF_COMMAND}, 178 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6, T_SELECT, TF_COMMAND},
179 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_ENDMENU, TF_COMMAND}, 179 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_ENDMENU, TF_COMMAND},
180 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_TRISTATE, TF_COMMAND}, 180 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_TYPE, TF_COMMAND, S_TRISTATE},
181 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9, T_ENDCHOICE, TF_COMMAND}, 181 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9, T_ENDCHOICE, TF_COMMAND},
182 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10, T_RANGE, TF_COMMAND}, 182 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10, T_RANGE, TF_COMMAND},
183 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11, T_STRING, TF_COMMAND}, 183 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11, T_TYPE, TF_COMMAND, S_STRING},
184 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND}, 184 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_UNKNOWN},
185 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEF_BOOLEAN, TF_COMMAND}, 185 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN},
186 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_MENU, TF_COMMAND}, 186 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_MENU, TF_COMMAND},
187 {-1}, 187 {-1},
188 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_DEF_BOOLEAN, TF_COMMAND}, 188 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_DEFAULT, TF_COMMAND, S_BOOLEAN},
189 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_DEF_TRISTATE, TF_COMMAND}, 189 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_DEFAULT, TF_COMMAND, S_TRISTATE},
190 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_MAINMENU, TF_COMMAND}, 190 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_MAINMENU, TF_COMMAND},
191 {-1}, 191 {-1},
192 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str20, T_MENUCONFIG, TF_COMMAND}, 192 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str20, T_MENUCONFIG, TF_COMMAND},
193 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_CONFIG, TF_COMMAND}, 193 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_CONFIG, TF_COMMAND},
194 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_ON, TF_PARAM}, 194 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_ON, TF_PARAM},
195 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_HEX, TF_COMMAND}, 195 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_TYPE, TF_COMMAND, S_HEX},
196 {-1}, {-1}, 196 {-1}, {-1},
197 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str26, T_SOURCE, TF_COMMAND}, 197 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str26, T_SOURCE, TF_COMMAND},
198 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_DEPENDS, TF_COMMAND}, 198 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_DEPENDS, TF_COMMAND},
@@ -201,9 +201,9 @@ kconf_id_lookup (register const char *str, register unsigned int len)
201 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SELECT, TF_COMMAND}, 201 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SELECT, TF_COMMAND},
202 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND}, 202 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND},
203 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_REQUIRES, TF_COMMAND}, 203 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_REQUIRES, TF_COMMAND},
204 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str34, T_BOOLEAN, TF_COMMAND}, 204 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str34, T_TYPE, TF_COMMAND, S_BOOLEAN},
205 {-1}, {-1}, 205 {-1}, {-1},
206 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_BOOLEAN, TF_COMMAND}, 206 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_TYPE, TF_COMMAND, S_BOOLEAN},
207 {-1}, {-1}, {-1}, 207 {-1}, {-1}, {-1},
208 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_CHOICE, TF_COMMAND}, 208 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_CHOICE, TF_COMMAND},
209 {-1}, {-1}, {-1}, {-1}, 209 {-1}, {-1}, {-1}, {-1},
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index ec902091be97..cfcfabd7a069 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -90,6 +90,7 @@ n [A-Za-z0-9_]
90 struct kconf_id *id = kconf_id_lookup(yytext, yyleng); 90 struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
91 if (id && id->flags & TF_COMMAND) { 91 if (id && id->flags & TF_COMMAND) {
92 BEGIN(PARAM); 92 BEGIN(PARAM);
93 zconflval.id = id;
93 return id->token; 94 return id->token;
94 } 95 }
95 alloc_string(yytext, yyleng); 96 alloc_string(yytext, yyleng);
@@ -117,8 +118,10 @@ n [A-Za-z0-9_]
117 --- /* ignore */ 118 --- /* ignore */
118 ({n}|[-/.])+ { 119 ({n}|[-/.])+ {
119 struct kconf_id *id = kconf_id_lookup(yytext, yyleng); 120 struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
120 if (id && id->flags & TF_PARAM) 121 if (id && id->flags & TF_PARAM) {
122 zconflval.id = id;
121 return id->token; 123 return id->token;
124 }
122 alloc_string(yytext, yyleng); 125 alloc_string(yytext, yyleng);
123 zconflval.string = text; 126 zconflval.string = text;
124 return T_WORD; 127 return T_WORD;
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped
index 07fa508d4659..3fc296274c98 100644
--- a/scripts/kconfig/zconf.tab.c_shipped
+++ b/scripts/kconfig/zconf.tab.c_shipped
@@ -78,28 +78,22 @@
78 T_REQUIRES = 272, 78 T_REQUIRES = 272,
79 T_OPTIONAL = 273, 79 T_OPTIONAL = 273,
80 T_PROMPT = 274, 80 T_PROMPT = 274,
81 T_DEFAULT = 275, 81 T_TYPE = 275,
82 T_TRISTATE = 276, 82 T_DEFAULT = 276,
83 T_DEF_TRISTATE = 277, 83 T_SELECT = 277,
84 T_BOOLEAN = 278, 84 T_RANGE = 278,
85 T_DEF_BOOLEAN = 279, 85 T_ON = 279,
86 T_STRING = 280, 86 T_WORD = 280,
87 T_INT = 281, 87 T_WORD_QUOTE = 281,
88 T_HEX = 282, 88 T_UNEQUAL = 282,
89 T_WORD = 283, 89 T_CLOSE_PAREN = 283,
90 T_WORD_QUOTE = 284, 90 T_OPEN_PAREN = 284,
91 T_UNEQUAL = 285, 91 T_EOL = 285,
92 T_EOF = 286, 92 T_EOF = 286,
93 T_EOL = 287, 93 T_OR = 287,
94 T_CLOSE_PAREN = 288, 94 T_AND = 288,
95 T_OPEN_PAREN = 289, 95 T_EQUAL = 289,
96 T_ON = 290, 96 T_NOT = 290
97 T_SELECT = 291,
98 T_RANGE = 292,
99 T_OR = 293,
100 T_AND = 294,
101 T_EQUAL = 295,
102 T_NOT = 296
103 }; 97 };
104#endif 98#endif
105#define T_MAINMENU 258 99#define T_MAINMENU 258
@@ -119,28 +113,22 @@
119#define T_REQUIRES 272 113#define T_REQUIRES 272
120#define T_OPTIONAL 273 114#define T_OPTIONAL 273
121#define T_PROMPT 274 115#define T_PROMPT 274
122#define T_DEFAULT 275 116#define T_TYPE 275
123#define T_TRISTATE 276 117#define T_DEFAULT 276
124#define T_DEF_TRISTATE 277 118#define T_SELECT 277
125#define T_BOOLEAN 278 119#define T_RANGE 278
126#define T_DEF_BOOLEAN 279 120#define T_ON 279
127#define T_STRING 280 121#define T_WORD 280
128#define T_INT 281 122#define T_WORD_QUOTE 281
129#define T_HEX 282 123#define T_UNEQUAL 282
130#define T_WORD 283 124#define T_CLOSE_PAREN 283
131#define T_WORD_QUOTE 284 125#define T_OPEN_PAREN 284
132#define T_UNEQUAL 285 126#define T_EOL 285
133#define T_EOF 286 127#define T_EOF 286
134#define T_EOL 287 128#define T_OR 287
135#define T_CLOSE_PAREN 288 129#define T_AND 288
136#define T_OPEN_PAREN 289 130#define T_EQUAL 289
137#define T_ON 290 131#define T_NOT 290
138#define T_SELECT 291
139#define T_RANGE 292
140#define T_OR 293
141#define T_AND 294
142#define T_EQUAL 295
143#define T_NOT 296
144 132
145 133
146 134
@@ -205,6 +193,7 @@ typedef union YYSTYPE {
205 struct symbol *symbol; 193 struct symbol *symbol;
206 struct expr *expr; 194 struct expr *expr;
207 struct menu *menu; 195 struct menu *menu;
196 struct kconf_id *id;
208} YYSTYPE; 197} YYSTYPE;
209/* Line 190 of yacc.c. */ 198/* Line 190 of yacc.c. */
210 199
@@ -321,20 +310,20 @@ union yyalloc
321/* YYFINAL -- State number of the termination state. */ 310/* YYFINAL -- State number of the termination state. */
322#define YYFINAL 2 311#define YYFINAL 2
323/* YYLAST -- Last index in YYTABLE. */ 312/* YYLAST -- Last index in YYTABLE. */
324#define YYLAST 201 313#define YYLAST 179
325 314
326/* YYNTOKENS -- Number of terminals. */ 315/* YYNTOKENS -- Number of terminals. */
327#define YYNTOKENS 42 316#define YYNTOKENS 36
328/* YYNNTS -- Number of nonterminals. */ 317/* YYNNTS -- Number of nonterminals. */
329#define YYNNTS 41 318#define YYNNTS 41
330/* YYNRULES -- Number of rules. */ 319/* YYNRULES -- Number of rules. */
331#define YYNRULES 104 320#define YYNRULES 97
332/* YYNRULES -- Number of states. */ 321/* YYNRULES -- Number of states. */
333#define YYNSTATES 182 322#define YYNSTATES 159
334 323
335/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 324/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
336#define YYUNDEFTOK 2 325#define YYUNDEFTOK 2
337#define YYMAXUTOK 296 326#define YYMAXUTOK 290
338 327
339#define YYTRANSLATE(YYX) \ 328#define YYTRANSLATE(YYX) \
340 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 329 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -371,7 +360,7 @@ static const unsigned char yytranslate[] =
371 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 360 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
372 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 361 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
373 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 362 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
374 35, 36, 37, 38, 39, 40, 41 363 35
375}; 364};
376 365
377#if YYDEBUG 366#if YYDEBUG
@@ -382,67 +371,62 @@ static const unsigned short int yyprhs[] =
382 0, 0, 3, 4, 7, 9, 11, 13, 17, 19, 371 0, 0, 3, 4, 7, 9, 11, 13, 17, 19,
383 21, 23, 26, 28, 30, 32, 34, 36, 38, 42, 372 21, 23, 26, 28, 30, 32, 34, 36, 38, 42,
384 45, 49, 52, 53, 56, 59, 62, 65, 69, 74, 373 45, 49, 52, 53, 56, 59, 62, 65, 69, 74,
385 78, 83, 87, 91, 95, 100, 105, 110, 116, 119, 374 79, 84, 90, 93, 96, 98, 102, 105, 106, 109,
386 122, 124, 128, 131, 132, 135, 138, 141, 144, 149, 375 112, 115, 118, 123, 127, 130, 135, 136, 139, 143,
387 153, 157, 160, 165, 166, 169, 173, 175, 179, 182, 376 145, 149, 152, 153, 156, 159, 162, 166, 169, 171,
388 183, 186, 189, 192, 196, 199, 201, 205, 208, 209, 377 175, 178, 179, 182, 185, 188, 192, 196, 198, 202,
389 212, 215, 218, 222, 226, 228, 232, 235, 238, 241, 378 205, 208, 211, 212, 215, 218, 223, 227, 231, 232,
390 242, 245, 248, 253, 257, 261, 262, 265, 267, 269, 379 235, 237, 239, 242, 245, 248, 250, 252, 253, 256,
391 272, 275, 278, 280, 282, 283, 286, 288, 292, 296, 380 258, 262, 266, 270, 273, 277, 281, 283
392 300, 303, 307, 311, 313
393}; 381};
394 382
395/* YYRHS -- A `-1'-separated list of the rules' RHS. */ 383/* YYRHS -- A `-1'-separated list of the rules' RHS. */
396static const yysigned_char yyrhs[] = 384static const yysigned_char yyrhs[] =
397{ 385{
398 43, 0, -1, -1, 43, 44, -1, 45, -1, 55, 386 37, 0, -1, -1, 37, 38, -1, 39, -1, 49,
399 -1, 66, -1, 3, 77, 79, -1, 5, -1, 15, 387 -1, 60, -1, 3, 71, 73, -1, 5, -1, 15,
400 -1, 8, -1, 1, 79, -1, 61, -1, 71, -1, 388 -1, 8, -1, 1, 73, -1, 55, -1, 65, -1,
401 47, -1, 49, -1, 69, -1, 79, -1, 10, 28, 389 41, -1, 43, -1, 63, -1, 73, -1, 10, 25,
402 32, -1, 46, 50, -1, 11, 28, 32, -1, 48, 390 30, -1, 40, 44, -1, 11, 25, 30, -1, 42,
403 50, -1, -1, 50, 51, -1, 50, 75, -1, 50, 391 44, -1, -1, 44, 45, -1, 44, 69, -1, 44,
404 73, -1, 50, 32, -1, 21, 76, 32, -1, 22, 392 67, -1, 44, 30, -1, 20, 70, 30, -1, 19,
405 81, 80, 32, -1, 23, 76, 32, -1, 24, 81, 393 71, 74, 30, -1, 21, 75, 74, 30, -1, 22,
406 80, 32, -1, 26, 76, 32, -1, 27, 76, 32, 394 25, 74, 30, -1, 23, 76, 76, 74, 30, -1,
407 -1, 25, 76, 32, -1, 19, 77, 80, 32, -1, 395 7, 30, -1, 46, 50, -1, 72, -1, 47, 52,
408 20, 81, 80, 32, -1, 36, 28, 80, 32, -1, 396 48, -1, 47, 52, -1, -1, 50, 51, -1, 50,
409 37, 82, 82, 80, 32, -1, 7, 32, -1, 52, 397 69, -1, 50, 67, -1, 50, 30, -1, 19, 71,
410 56, -1, 78, -1, 53, 58, 54, -1, 53, 58, 398 74, 30, -1, 20, 70, 30, -1, 18, 30, -1,
411 -1, -1, 56, 57, -1, 56, 75, -1, 56, 73, 399 21, 25, 74, 30, -1, -1, 52, 39, -1, 14,
412 -1, 56, 32, -1, 19, 77, 80, 32, -1, 21, 400 75, 30, -1, 72, -1, 53, 56, 54, -1, 53,
413 76, 32, -1, 23, 76, 32, -1, 18, 32, -1, 401 56, -1, -1, 56, 39, -1, 56, 60, -1, 56,
414 20, 28, 80, 32, -1, -1, 58, 45, -1, 14, 402 49, -1, 4, 71, 30, -1, 57, 68, -1, 72,
415 81, 32, -1, 78, -1, 59, 62, 60, -1, 59, 403 -1, 58, 61, 59, -1, 58, 61, -1, -1, 61,
416 62, -1, -1, 62, 45, -1, 62, 66, -1, 62, 404 39, -1, 61, 60, -1, 61, 49, -1, 61, 1,
417 55, -1, 4, 77, 32, -1, 63, 74, -1, 78, 405 30, -1, 6, 71, 30, -1, 62, -1, 9, 71,
418 -1, 64, 67, 65, -1, 64, 67, -1, -1, 67, 406 30, -1, 64, 68, -1, 12, 30, -1, 66, 13,
419 45, -1, 67, 66, -1, 67, 55, -1, 67, 1, 407 -1, -1, 68, 69, -1, 68, 30, -1, 16, 24,
420 32, -1, 6, 77, 32, -1, 68, -1, 9, 77, 408 75, 30, -1, 16, 75, 30, -1, 17, 75, 30,
421 32, -1, 70, 74, -1, 12, 32, -1, 72, 13, 409 -1, -1, 71, 74, -1, 25, -1, 26, -1, 5,
422 -1, -1, 74, 75, -1, 74, 32, -1, 16, 35, 410 73, -1, 8, 73, -1, 15, 73, -1, 30, -1,
423 81, 32, -1, 16, 81, 32, -1, 17, 81, 32, 411 31, -1, -1, 14, 75, -1, 76, -1, 76, 34,
424 -1, -1, 77, 80, -1, 28, -1, 29, -1, 5, 412 76, -1, 76, 27, 76, -1, 29, 75, 28, -1,
425 79, -1, 8, 79, -1, 15, 79, -1, 32, -1, 413 35, 75, -1, 75, 32, 75, -1, 75, 33, 75,
426 31, -1, -1, 14, 81, -1, 82, -1, 82, 40, 414 -1, 25, -1, 26, -1
427 82, -1, 82, 30, 82, -1, 34, 81, 33, -1,
428 41, 81, -1, 81, 38, 81, -1, 81, 39, 81,
429 -1, 28, -1, 29, -1
430}; 415};
431 416
432/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 417/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
433static const unsigned short int yyrline[] = 418static const unsigned short int yyrline[] =
434{ 419{
435 0, 97, 97, 98, 101, 102, 103, 104, 105, 106, 420 0, 92, 92, 93, 96, 97, 98, 99, 100, 101,
436 107, 108, 112, 113, 114, 115, 116, 117, 123, 131, 421 102, 103, 107, 108, 109, 110, 111, 112, 118, 126,
437 137, 145, 155, 157, 158, 159, 160, 163, 169, 176, 422 132, 140, 150, 152, 153, 154, 155, 158, 166, 172,
438 182, 189, 195, 201, 207, 213, 219, 225, 233, 242, 423 182, 188, 196, 205, 211, 220, 221, 227, 229, 230,
439 248, 257, 258, 264, 266, 267, 268, 269, 272, 278, 424 231, 232, 235, 241, 252, 258, 268, 270, 275, 284,
440 284, 290, 296, 302, 304, 309, 318, 327, 328, 334, 425 293, 294, 300, 302, 303, 304, 309, 316, 322, 331,
441 336, 337, 338, 343, 350, 356, 365, 366, 372, 374, 426 332, 338, 340, 341, 342, 343, 346, 352, 359, 366,
442 375, 376, 377, 380, 386, 393, 400, 407, 413, 420, 427 373, 379, 386, 387, 388, 391, 396, 401, 409, 411,
443 421, 422, 425, 430, 435, 443, 445, 450, 451, 454, 428 416, 417, 420, 421, 422, 426, 426, 428, 429, 432,
444 455, 456, 460, 460, 462, 463, 466, 467, 468, 469, 429 433, 434, 435, 436, 437, 438, 441, 442
445 470, 471, 472, 475, 476
446}; 430};
447#endif 431#endif
448 432
@@ -454,11 +438,10 @@ static const char *const yytname[] =
454 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU", 438 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
455 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", 439 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
456 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", 440 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
457 "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE", 441 "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT",
458 "T_DEF_TRISTATE", "T_BOOLEAN", "T_DEF_BOOLEAN", "T_STRING", "T_INT", 442 "T_SELECT", "T_RANGE", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
459 "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_EOF", "T_EOL", 443 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_EOF", "T_OR", "T_AND",
460 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_SELECT", "T_RANGE", "T_OR", 444 "T_EQUAL", "T_NOT", "$accept", "input", "block", "common_block",
461 "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block", "common_block",
462 "config_entry_start", "config_stmt", "menuconfig_entry_start", 445 "config_entry_start", "config_stmt", "menuconfig_entry_start",
463 "menuconfig_stmt", "config_option_list", "config_option", "choice", 446 "menuconfig_stmt", "config_option_list", "config_option", "choice",
464 "choice_entry", "choice_end", "choice_stmt", "choice_option_list", 447 "choice_entry", "choice_end", "choice_stmt", "choice_option_list",
@@ -478,25 +461,23 @@ static const unsigned short int yytoknum[] =
478 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 461 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
479 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 462 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
480 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 463 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
481 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 464 285, 286, 287, 288, 289, 290
482 295, 296
483}; 465};
484# endif 466# endif
485 467
486/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 468/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
487static const unsigned char yyr1[] = 469static const unsigned char yyr1[] =
488{ 470{
489 0, 42, 43, 43, 44, 44, 44, 44, 44, 44, 471 0, 36, 37, 37, 38, 38, 38, 38, 38, 38,
490 44, 44, 45, 45, 45, 45, 45, 45, 46, 47, 472 38, 38, 39, 39, 39, 39, 39, 39, 40, 41,
491 48, 49, 50, 50, 50, 50, 50, 51, 51, 51, 473 42, 43, 44, 44, 44, 44, 44, 45, 45, 45,
492 51, 51, 51, 51, 51, 51, 51, 51, 52, 53, 474 45, 45, 46, 47, 48, 49, 49, 50, 50, 50,
493 54, 55, 55, 56, 56, 56, 56, 56, 57, 57, 475 50, 50, 51, 51, 51, 51, 52, 52, 53, 54,
494 57, 57, 57, 58, 58, 59, 60, 61, 61, 62, 476 55, 55, 56, 56, 56, 56, 57, 58, 59, 60,
495 62, 62, 62, 63, 64, 65, 66, 66, 67, 67, 477 60, 61, 61, 61, 61, 61, 62, 63, 64, 65,
496 67, 67, 67, 68, 69, 70, 71, 72, 73, 74, 478 66, 67, 68, 68, 68, 69, 69, 69, 70, 70,
497 74, 74, 75, 75, 75, 76, 76, 77, 77, 78, 479 71, 71, 72, 72, 72, 73, 73, 74, 74, 75,
498 78, 78, 79, 79, 80, 80, 81, 81, 81, 81, 480 75, 75, 75, 75, 75, 75, 76, 76
499 81, 81, 81, 82, 82
500}; 481};
501 482
502/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 483/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
@@ -504,15 +485,14 @@ static const unsigned char yyr2[] =
504{ 485{
505 0, 2, 0, 2, 1, 1, 1, 3, 1, 1, 486 0, 2, 0, 2, 1, 1, 1, 3, 1, 1,
506 1, 2, 1, 1, 1, 1, 1, 1, 3, 2, 487 1, 2, 1, 1, 1, 1, 1, 1, 3, 2,
507 3, 2, 0, 2, 2, 2, 2, 3, 4, 3, 488 3, 2, 0, 2, 2, 2, 2, 3, 4, 4,
508 4, 3, 3, 3, 4, 4, 4, 5, 2, 2, 489 4, 5, 2, 2, 1, 3, 2, 0, 2, 2,
509 1, 3, 2, 0, 2, 2, 2, 2, 4, 3, 490 2, 2, 4, 3, 2, 4, 0, 2, 3, 1,
510 3, 2, 4, 0, 2, 3, 1, 3, 2, 0, 491 3, 2, 0, 2, 2, 2, 3, 2, 1, 3,
511 2, 2, 2, 3, 2, 1, 3, 2, 0, 2, 492 2, 0, 2, 2, 2, 3, 3, 1, 3, 2,
512 2, 2, 3, 3, 1, 3, 2, 2, 2, 0, 493 2, 2, 0, 2, 2, 4, 3, 3, 0, 2,
513 2, 2, 4, 3, 3, 0, 2, 1, 1, 2, 494 1, 1, 2, 2, 2, 1, 1, 0, 2, 1,
514 2, 2, 1, 1, 0, 2, 1, 3, 3, 3, 495 3, 3, 3, 2, 3, 3, 1, 1
515 2, 3, 3, 1, 1
516}; 496};
517 497
518/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 498/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -521,69 +501,63 @@ static const unsigned char yyr2[] =
521static const unsigned char yydefact[] = 501static const unsigned char yydefact[] =
522{ 502{
523 2, 0, 1, 0, 0, 0, 8, 0, 0, 10, 503 2, 0, 1, 0, 0, 0, 8, 0, 0, 10,
524 0, 0, 0, 0, 9, 93, 92, 3, 4, 22, 504 0, 0, 0, 0, 9, 85, 86, 3, 4, 22,
525 14, 22, 15, 43, 53, 5, 59, 12, 79, 68, 505 14, 22, 15, 37, 46, 5, 52, 12, 72, 61,
526 6, 74, 16, 79, 13, 17, 11, 87, 88, 0, 506 6, 67, 16, 72, 13, 17, 11, 80, 81, 0,
527 0, 0, 38, 0, 0, 0, 103, 104, 0, 0, 507 0, 0, 32, 0, 0, 0, 96, 97, 0, 0,
528 0, 96, 19, 21, 39, 42, 58, 64, 0, 76, 508 0, 89, 19, 21, 33, 36, 51, 57, 0, 69,
529 7, 63, 73, 75, 18, 20, 0, 100, 55, 0, 509 7, 56, 66, 68, 18, 20, 0, 93, 48, 0,
530 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, 510 0, 0, 0, 0, 0, 0, 0, 78, 0, 0,
531 85, 0, 85, 85, 85, 26, 0, 0, 23, 0, 511 0, 26, 23, 0, 25, 24, 0, 0, 78, 0,
532 25, 24, 0, 0, 0, 85, 85, 47, 44, 46, 512 41, 38, 40, 39, 0, 0, 0, 47, 35, 34,
533 45, 0, 0, 0, 54, 41, 40, 60, 62, 57, 513 53, 55, 50, 54, 49, 74, 73, 0, 62, 64,
534 61, 56, 81, 80, 0, 69, 71, 66, 70, 65, 514 59, 63, 58, 92, 94, 95, 91, 90, 70, 0,
535 99, 101, 102, 98, 97, 77, 0, 0, 0, 94, 515 0, 0, 87, 0, 87, 87, 87, 0, 71, 44,
536 94, 0, 94, 94, 0, 94, 0, 0, 0, 94, 516 87, 0, 87, 82, 83, 84, 65, 0, 76, 77,
537 0, 78, 51, 94, 94, 0, 0, 89, 90, 91, 517 0, 0, 27, 79, 0, 0, 87, 0, 43, 0,
538 72, 0, 83, 84, 0, 0, 0, 27, 86, 0, 518 75, 88, 28, 29, 30, 0, 42, 45, 31
539 29, 0, 33, 31, 32, 0, 94, 0, 0, 49,
540 50, 82, 95, 34, 35, 28, 30, 36, 0, 48,
541 52, 37
542}; 519};
543 520
544/* YYDEFGOTO[NTERM-NUM]. */ 521/* YYDEFGOTO[NTERM-NUM]. */
545static const short int yydefgoto[] = 522static const short int yydefgoto[] =
546{ 523{
547 -1, 1, 17, 18, 19, 20, 21, 22, 52, 88, 524 -1, 1, 17, 18, 19, 20, 21, 22, 52, 82,
548 23, 24, 105, 25, 54, 98, 55, 26, 109, 27, 525 23, 24, 98, 25, 54, 91, 55, 26, 102, 27,
549 56, 28, 29, 117, 30, 58, 31, 32, 33, 34, 526 56, 28, 29, 110, 30, 58, 31, 32, 33, 34,
550 89, 90, 57, 91, 131, 132, 106, 35, 155, 50, 527 83, 84, 57, 85, 123, 124, 99, 35, 141, 50,
551 51 528 51
552}; 529};
553 530
554/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 531/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
555 STATE-NUM. */ 532 STATE-NUM. */
556#define YYPACT_NINF -99 533#define YYPACT_NINF -113
557static const short int yypact[] = 534static const short int yypact[] =
558{ 535{
559 -99, 48, -99, 38, 46, 46, -99, 46, -29, -99, 536 -113, 37, -113, 114, 136, 136, -113, 136, -29, -113,
560 46, -17, -3, -11, -99, -99, -99, -99, -99, -99, 537 136, -19, -14, -10, -113, -113, -113, -113, -113, -113,
561 -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, 538 -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
562 -99, -99, -99, -99, -99, -99, -99, -99, -99, 38, 539 -113, -113, -113, -113, -113, -113, -113, -113, -113, 114,
563 12, 15, -99, 18, 51, 62, -99, -99, -11, -11, 540 9, 25, -113, 56, 60, 65, -113, -113, -10, -10,
564 4, -24, 138, 138, 160, 121, 110, -4, 81, -4, 541 33, -1, 108, 108, 41, 103, 92, 5, 74, 5,
565 -99, -99, -99, -99, -99, -99, -19, -99, -99, -11, 542 -113, -113, -113, -113, -113, -113, 115, -113, -113, -10,
566 -11, 70, 70, 73, 32, -11, 46, -11, 46, -11, 543 -10, 138, 138, 80, 111, -10, 136, 136, -10, 2,
567 46, -11, 46, 46, 46, -99, 36, 70, -99, 95, 544 138, -113, -113, 113, -113, -113, 85, 136, 136, 107,
568 -99, -99, 96, 46, 106, 46, 46, -99, -99, -99, 545 -113, -113, -113, -113, 114, 114, 114, -113, -113, -113,
569 -99, 38, 38, 38, -99, -99, -99, -99, -99, -99, 546 -113, -113, -113, -113, -113, -113, -113, 120, -113, -113,
570 -99, -99, -99, -99, 112, -99, -99, -99, -99, -99, 547 -113, -113, -113, -113, 121, -113, -113, -113, -113, -10,
571 -99, 117, -99, -99, -99, -99, -11, 33, 65, 131, 548 109, 119, 16, 137, 16, 17, 16, 138, -113, -113,
572 1, 119, 131, 1, 136, 1, 153, 154, 155, 131, 549 16, 139, 16, -113, -113, -113, -113, 123, -113, -113,
573 70, -99, -99, 131, 131, 156, 157, -99, -99, -99, 550 -10, 140, -113, -113, 141, 142, 16, 143, -113, 144,
574 -99, 101, -99, -99, -11, 158, 159, -99, -99, 161, 551 -113, 133, -113, -113, -113, 145, -113, -113, -113
575 -99, 162, -99, -99, -99, 163, 131, 164, 165, -99,
576 -99, -99, 99, -99, -99, -99, -99, -99, 166, -99,
577 -99, -99
578}; 552};
579 553
580/* YYPGOTO[NTERM-NUM]. */ 554/* YYPGOTO[NTERM-NUM]. */
581static const short int yypgoto[] = 555static const short int yypgoto[] =
582{ 556{
583 -99, -99, -99, 111, -99, -99, -99, -99, 178, -99, 557 -113, -113, -113, 14, -113, -113, -113, -113, 147, -113,
584 -99, -99, -99, 91, -99, -99, -99, -99, -99, -99, 558 -113, -113, -113, -2, -113, -113, -113, -113, -113, -113,
585 -99, -99, -99, -99, 115, -99, -99, -99, -99, -99, 559 -113, -113, -113, -113, 101, -113, -113, -113, -113, -113,
586 -99, 146, 168, 89, 27, 0, 126, -1, -98, -48, 560 -113, 122, 146, 62, 89, 0, 102, -3, -112, -46,
587 -63 561 -63
588}; 562};
589 563
@@ -591,80 +565,71 @@ static const short int yypgoto[] =
591 positive, shift that token. If negative, reduce the rule which 565 positive, shift that token. If negative, reduce the rule which
592 number is the opposite. If zero, do what YYDEFACT says. 566 number is the opposite. If zero, do what YYDEFACT says.
593 If YYTABLE_NINF, syntax error. */ 567 If YYTABLE_NINF, syntax error. */
594#define YYTABLE_NINF -68 568#define YYTABLE_NINF -61
595static const short int yytable[] = 569static const short int yytable[] =
596{ 570{
597 66, 67, 36, 42, 39, 40, 71, 41, 123, 124, 571 36, 42, 66, 67, 39, 40, 44, 41, 116, 117,
598 43, 44, 74, 75, 120, 154, 72, 46, 47, 69, 572 43, 45, 143, 144, 145, 46, 47, 127, 147, 48,
599 70, 121, 122, 48, 140, 45, 127, 128, 112, 130, 573 149, 74, 75, 114, 115, 49, 71, 126, 120, 121,
600 49, 133, 156, 135, 158, 159, 68, 161, 60, 69, 574 140, 140, 125, 72, 155, 105, 60, 2, 3, 61,
601 70, 165, 69, 70, 61, 167, 168, 62, 2, 3, 575 4, 5, 6, 7, 8, 9, 10, 11, 12, 69,
602 63, 4, 5, 6, 7, 8, 9, 10, 11, 12, 576 70, 13, 14, 73, 101, 62, 109, 74, 75, 86,
603 46, 47, 13, 14, 139, 152, 48, 126, 178, 15, 577 87, 88, 89, 68, 146, 69, 70, 15, 16, 97,
604 16, 69, 70, 49, 37, 38, 129, 166, 151, 15, 578 100, 90, 108, 137, -60, 107, 122, -60, 5, 94,
605 16, -67, 114, 64, -67, 5, 101, 7, 8, 102, 579 7, 8, 95, 10, 11, 12, 63, 130, 13, 96,
606 10, 11, 12, 143, 65, 13, 103, 153, 46, 47, 580 64, 133, 134, 135, 151, 65, 5, 94, 7, 8,
607 147, 148, 149, 69, 70, 125, 172, 134, 141, 136, 581 95, 10, 11, 12, 15, 16, 13, 96, 94, 7,
608 137, 138, 15, 16, 5, 101, 7, 8, 102, 10, 582 118, 95, 10, 11, 12, 129, 93, 13, 96, 106,
609 11, 12, 145, 146, 13, 103, 101, 7, 142, 102, 583 73, 106, 15, 16, 74, 75, 128, 76, 77, 78,
610 10, 11, 12, 171, 144, 13, 103, 69, 70, 69, 584 79, 80, 132, 15, 16, 119, 46, 47, 81, 138,
611 70, 15, 16, 100, 150, 154, 113, 108, 113, 116, 585 48, 69, 70, 113, 15, 16, 49, 69, 70, 139,
612 73, 157, 15, 16, 74, 75, 70, 76, 77, 78, 586 136, 69, 70, 150, 70, 69, 70, 103, 104, 111,
613 79, 80, 81, 82, 83, 84, 104, 107, 160, 115, 587 112, 37, 38, 46, 47, 69, 70, 142, 53, 148,
614 85, 110, 73, 118, 86, 87, 74, 75, 92, 93, 588 152, 153, 154, 156, 157, 158, 92, 131, 0, 59
615 94, 95, 111, 96, 119, 162, 163, 164, 169, 170,
616 173, 174, 97, 175, 176, 177, 179, 180, 181, 53,
617 99, 59
618}; 589};
619 590
620static const unsigned char yycheck[] = 591static const short int yycheck[] =
621{ 592{
622 48, 49, 3, 32, 4, 5, 30, 7, 71, 72, 593 3, 30, 48, 49, 4, 5, 25, 7, 71, 72,
623 10, 28, 16, 17, 33, 14, 40, 28, 29, 38, 594 10, 25, 124, 125, 126, 25, 26, 80, 130, 29,
624 39, 69, 70, 34, 87, 28, 74, 75, 32, 77, 595 132, 16, 17, 69, 70, 35, 27, 25, 74, 75,
625 41, 79, 130, 81, 132, 133, 32, 135, 39, 38, 596 14, 14, 78, 34, 146, 30, 39, 0, 1, 30,
626 39, 139, 38, 39, 32, 143, 144, 32, 0, 1, 597 3, 4, 5, 6, 7, 8, 9, 10, 11, 32,
627 32, 3, 4, 5, 6, 7, 8, 9, 10, 11, 598 33, 14, 15, 12, 56, 30, 58, 16, 17, 18,
628 28, 29, 14, 15, 28, 32, 34, 35, 166, 31, 599 19, 20, 21, 30, 127, 32, 33, 30, 31, 55,
629 32, 38, 39, 41, 28, 29, 76, 140, 126, 31, 600 56, 30, 58, 119, 0, 1, 76, 3, 4, 5,
630 32, 0, 1, 32, 3, 4, 5, 6, 7, 8, 601 6, 7, 8, 9, 10, 11, 30, 87, 14, 15,
631 9, 10, 11, 93, 32, 14, 15, 32, 28, 29, 602 30, 94, 95, 96, 140, 30, 4, 5, 6, 7,
632 101, 102, 103, 38, 39, 32, 154, 80, 13, 82, 603 8, 9, 10, 11, 30, 31, 14, 15, 5, 6,
633 83, 84, 31, 32, 4, 5, 6, 7, 8, 9, 604 30, 8, 9, 10, 11, 30, 54, 14, 15, 57,
634 10, 11, 95, 96, 14, 15, 5, 6, 32, 8, 605 12, 59, 30, 31, 16, 17, 13, 19, 20, 21,
635 9, 10, 11, 32, 28, 14, 15, 38, 39, 38, 606 22, 23, 25, 30, 31, 24, 25, 26, 30, 30,
636 39, 31, 32, 54, 32, 14, 57, 56, 59, 58, 607 29, 32, 33, 28, 30, 31, 35, 32, 33, 30,
637 12, 32, 31, 32, 16, 17, 39, 19, 20, 21, 608 30, 32, 33, 30, 33, 32, 33, 56, 56, 58,
638 22, 23, 24, 25, 26, 27, 55, 56, 32, 58, 609 58, 25, 26, 25, 26, 32, 33, 30, 21, 30,
639 32, 56, 12, 58, 36, 37, 16, 17, 18, 19, 610 30, 30, 30, 30, 30, 30, 54, 88, -1, 33
640 20, 21, 56, 23, 58, 32, 32, 32, 32, 32,
641 32, 32, 32, 32, 32, 32, 32, 32, 32, 21,
642 54, 33
643}; 611};
644 612
645/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 613/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
646 symbol of state STATE-NUM. */ 614 symbol of state STATE-NUM. */
647static const unsigned char yystos[] = 615static const unsigned char yystos[] =
648{ 616{
649 0, 43, 0, 1, 3, 4, 5, 6, 7, 8, 617 0, 37, 0, 1, 3, 4, 5, 6, 7, 8,
650 9, 10, 11, 14, 15, 31, 32, 44, 45, 46, 618 9, 10, 11, 14, 15, 30, 31, 38, 39, 40,
651 47, 48, 49, 52, 53, 55, 59, 61, 63, 64, 619 41, 42, 43, 46, 47, 49, 53, 55, 57, 58,
652 66, 68, 69, 70, 71, 79, 79, 28, 29, 77, 620 60, 62, 63, 64, 65, 73, 73, 25, 26, 71,
653 77, 77, 32, 77, 28, 28, 28, 29, 34, 41, 621 71, 71, 30, 71, 25, 25, 25, 26, 29, 35,
654 81, 82, 50, 50, 56, 58, 62, 74, 67, 74, 622 75, 76, 44, 44, 50, 52, 56, 68, 61, 68,
655 79, 32, 32, 32, 32, 32, 81, 81, 32, 38, 623 73, 30, 30, 30, 30, 30, 75, 75, 30, 32,
656 39, 30, 40, 12, 16, 17, 19, 20, 21, 22, 624 33, 27, 34, 12, 16, 17, 19, 20, 21, 22,
657 23, 24, 25, 26, 27, 32, 36, 37, 51, 72, 625 23, 30, 45, 66, 67, 69, 18, 19, 20, 21,
658 73, 75, 18, 19, 20, 21, 23, 32, 57, 73, 626 30, 51, 67, 69, 5, 8, 15, 39, 48, 72,
659 75, 5, 8, 15, 45, 54, 78, 45, 55, 60, 627 39, 49, 54, 60, 72, 30, 69, 1, 39, 49,
660 66, 78, 32, 75, 1, 45, 55, 65, 66, 78, 628 59, 60, 72, 28, 75, 75, 76, 76, 30, 24,
661 33, 81, 81, 82, 82, 32, 35, 81, 81, 77, 629 75, 75, 71, 70, 71, 75, 25, 76, 13, 30,
662 81, 76, 77, 81, 76, 81, 76, 76, 76, 28, 630 71, 70, 25, 73, 73, 73, 30, 75, 30, 30,
663 82, 13, 32, 77, 28, 76, 76, 79, 79, 79, 631 14, 74, 30, 74, 74, 74, 76, 74, 30, 74,
664 32, 81, 32, 32, 14, 80, 80, 32, 80, 80, 632 30, 75, 30, 30, 30, 74, 30, 30, 30
665 32, 80, 32, 32, 32, 80, 82, 80, 80, 32,
666 32, 32, 81, 32, 32, 32, 32, 32, 80, 32,
667 32, 32
668}; 633};
669 634
670#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) 635#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
@@ -1367,78 +1332,34 @@ yyreduce:
1367 case 27: 1332 case 27:
1368 1333
1369 { 1334 {
1370 menu_set_type(S_TRISTATE); 1335 menu_set_type((yyvsp[-2].id)->stype);
1371 printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno()); 1336 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1337 zconf_curname(), zconf_lineno(),
1338 (yyvsp[-2].id)->stype);
1372;} 1339;}
1373 break; 1340 break;
1374 1341
1375 case 28: 1342 case 28:
1376 1343
1377 { 1344 {
1378 menu_add_expr(P_DEFAULT, (yyvsp[-2].expr), (yyvsp[-1].expr));
1379 menu_set_type(S_TRISTATE);
1380 printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
1381;}
1382 break;
1383
1384 case 29:
1385
1386 {
1387 menu_set_type(S_BOOLEAN);
1388 printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
1389;}
1390 break;
1391
1392 case 30:
1393
1394 {
1395 menu_add_expr(P_DEFAULT, (yyvsp[-2].expr), (yyvsp[-1].expr));
1396 menu_set_type(S_BOOLEAN);
1397 printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
1398;}
1399 break;
1400
1401 case 31:
1402
1403 {
1404 menu_set_type(S_INT);
1405 printd(DEBUG_PARSE, "%s:%d:int\n", zconf_curname(), zconf_lineno());
1406;}
1407 break;
1408
1409 case 32:
1410
1411 {
1412 menu_set_type(S_HEX);
1413 printd(DEBUG_PARSE, "%s:%d:hex\n", zconf_curname(), zconf_lineno());
1414;}
1415 break;
1416
1417 case 33:
1418
1419 {
1420 menu_set_type(S_STRING);
1421 printd(DEBUG_PARSE, "%s:%d:string\n", zconf_curname(), zconf_lineno());
1422;}
1423 break;
1424
1425 case 34:
1426
1427 {
1428 menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr)); 1345 menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr));
1429 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); 1346 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1430;} 1347;}
1431 break; 1348 break;
1432 1349
1433 case 35: 1350 case 29:
1434 1351
1435 { 1352 {
1436 menu_add_expr(P_DEFAULT, (yyvsp[-2].expr), (yyvsp[-1].expr)); 1353 menu_add_expr(P_DEFAULT, (yyvsp[-2].expr), (yyvsp[-1].expr));
1437 printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); 1354 if ((yyvsp[-3].id)->stype != S_UNKNOWN)
1355 menu_set_type((yyvsp[-3].id)->stype);
1356 printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
1357 zconf_curname(), zconf_lineno(),
1358 (yyvsp[-3].id)->stype);
1438;} 1359;}
1439 break; 1360 break;
1440 1361
1441 case 36: 1362 case 30:
1442 1363
1443 { 1364 {
1444 menu_add_symbol(P_SELECT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr)); 1365 menu_add_symbol(P_SELECT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr));
@@ -1446,7 +1367,7 @@ yyreduce:
1446;} 1367;}
1447 break; 1368 break;
1448 1369
1449 case 37: 1370 case 31:
1450 1371
1451 { 1372 {
1452 menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[-3].symbol), (yyvsp[-2].symbol)), (yyvsp[-1].expr)); 1373 menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[-3].symbol), (yyvsp[-2].symbol)), (yyvsp[-1].expr));
@@ -1454,7 +1375,7 @@ yyreduce:
1454;} 1375;}
1455 break; 1376 break;
1456 1377
1457 case 38: 1378 case 32:
1458 1379
1459 { 1380 {
1460 struct symbol *sym = sym_lookup(NULL, 0); 1381 struct symbol *sym = sym_lookup(NULL, 0);
@@ -1465,7 +1386,7 @@ yyreduce:
1465;} 1386;}
1466 break; 1387 break;
1467 1388
1468 case 39: 1389 case 33:
1469 1390
1470 { 1391 {
1471 menu_end_entry(); 1392 menu_end_entry();
@@ -1473,7 +1394,7 @@ yyreduce:
1473;} 1394;}
1474 break; 1395 break;
1475 1396
1476 case 40: 1397 case 34:
1477 1398
1478 { 1399 {
1479 if (zconf_endtoken((yyvsp[0].token), T_CHOICE, T_ENDCHOICE)) { 1400 if (zconf_endtoken((yyvsp[0].token), T_CHOICE, T_ENDCHOICE)) {
@@ -1483,7 +1404,7 @@ yyreduce:
1483;} 1404;}
1484 break; 1405 break;
1485 1406
1486 case 42: 1407 case 36:
1487 1408
1488 { 1409 {
1489 printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno); 1410 printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno);
@@ -1491,7 +1412,7 @@ yyreduce:
1491;} 1412;}
1492 break; 1413 break;
1493 1414
1494 case 48: 1415 case 42:
1495 1416
1496 { 1417 {
1497 menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr)); 1418 menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr));
@@ -1499,23 +1420,20 @@ yyreduce:
1499;} 1420;}
1500 break; 1421 break;
1501 1422
1502 case 49: 1423 case 43:
1503
1504 {
1505 menu_set_type(S_TRISTATE);
1506 printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
1507;}
1508 break;
1509
1510 case 50:
1511 1424
1512 { 1425 {
1513 menu_set_type(S_BOOLEAN); 1426 if ((yyvsp[-2].id)->stype == S_BOOLEAN || (yyvsp[-2].id)->stype == S_TRISTATE) {
1514 printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno()); 1427 menu_set_type((yyvsp[-2].id)->stype);
1428 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1429 zconf_curname(), zconf_lineno(),
1430 (yyvsp[-2].id)->stype);
1431 } else
1432 YYERROR;
1515;} 1433;}
1516 break; 1434 break;
1517 1435
1518 case 51: 1436 case 44:
1519 1437
1520 { 1438 {
1521 current_entry->sym->flags |= SYMBOL_OPTIONAL; 1439 current_entry->sym->flags |= SYMBOL_OPTIONAL;
@@ -1523,15 +1441,19 @@ yyreduce:
1523;} 1441;}
1524 break; 1442 break;
1525 1443
1526 case 52: 1444 case 45:
1527 1445
1528 { 1446 {
1529 menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr)); 1447 if ((yyvsp[-3].id)->stype == S_UNKNOWN) {
1530 printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); 1448 menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr));
1449 printd(DEBUG_PARSE, "%s:%d:default\n",
1450 zconf_curname(), zconf_lineno());
1451 } else
1452 YYERROR;
1531;} 1453;}
1532 break; 1454 break;
1533 1455
1534 case 55: 1456 case 48:
1535 1457
1536 { 1458 {
1537 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); 1459 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
@@ -1542,7 +1464,7 @@ yyreduce:
1542;} 1464;}
1543 break; 1465 break;
1544 1466
1545 case 56: 1467 case 49:
1546 1468
1547 { 1469 {
1548 if (zconf_endtoken((yyvsp[0].token), T_IF, T_ENDIF)) { 1470 if (zconf_endtoken((yyvsp[0].token), T_IF, T_ENDIF)) {
@@ -1552,7 +1474,7 @@ yyreduce:
1552;} 1474;}
1553 break; 1475 break;
1554 1476
1555 case 58: 1477 case 51:
1556 1478
1557 { 1479 {
1558 printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno); 1480 printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno);
@@ -1560,7 +1482,7 @@ yyreduce:
1560;} 1482;}
1561 break; 1483 break;
1562 1484
1563 case 63: 1485 case 56:
1564 1486
1565 { 1487 {
1566 menu_add_entry(NULL); 1488 menu_add_entry(NULL);
@@ -1569,7 +1491,7 @@ yyreduce:
1569;} 1491;}
1570 break; 1492 break;
1571 1493
1572 case 64: 1494 case 57:
1573 1495
1574 { 1496 {
1575 menu_end_entry(); 1497 menu_end_entry();
@@ -1577,7 +1499,7 @@ yyreduce:
1577;} 1499;}
1578 break; 1500 break;
1579 1501
1580 case 65: 1502 case 58:
1581 1503
1582 { 1504 {
1583 if (zconf_endtoken((yyvsp[0].token), T_MENU, T_ENDMENU)) { 1505 if (zconf_endtoken((yyvsp[0].token), T_MENU, T_ENDMENU)) {
@@ -1587,7 +1509,7 @@ yyreduce:
1587;} 1509;}
1588 break; 1510 break;
1589 1511
1590 case 67: 1512 case 60:
1591 1513
1592 { 1514 {
1593 printf("%s:%d: missing 'endmenu' for this 'menu' statement\n", current_menu->file->name, current_menu->lineno); 1515 printf("%s:%d: missing 'endmenu' for this 'menu' statement\n", current_menu->file->name, current_menu->lineno);
@@ -1595,12 +1517,12 @@ yyreduce:
1595;} 1517;}
1596 break; 1518 break;
1597 1519
1598 case 72: 1520 case 65:
1599 1521
1600 { zconfprint("invalid menu option"); yyerrok; ;} 1522 { zconfprint("invalid menu option"); yyerrok; ;}
1601 break; 1523 break;
1602 1524
1603 case 73: 1525 case 66:
1604 1526
1605 { 1527 {
1606 (yyval.string) = (yyvsp[-1].string); 1528 (yyval.string) = (yyvsp[-1].string);
@@ -1608,14 +1530,14 @@ yyreduce:
1608;} 1530;}
1609 break; 1531 break;
1610 1532
1611 case 74: 1533 case 67:
1612 1534
1613 { 1535 {
1614 zconf_nextfile((yyvsp[0].string)); 1536 zconf_nextfile((yyvsp[0].string));
1615;} 1537;}
1616 break; 1538 break;
1617 1539
1618 case 75: 1540 case 68:
1619 1541
1620 { 1542 {
1621 menu_add_entry(NULL); 1543 menu_add_entry(NULL);
@@ -1624,14 +1546,14 @@ yyreduce:
1624;} 1546;}
1625 break; 1547 break;
1626 1548
1627 case 76: 1549 case 69:
1628 1550
1629 { 1551 {
1630 menu_end_entry(); 1552 menu_end_entry();
1631;} 1553;}
1632 break; 1554 break;
1633 1555
1634 case 77: 1556 case 70:
1635 1557
1636 { 1558 {
1637 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); 1559 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
@@ -1639,14 +1561,14 @@ yyreduce:
1639;} 1561;}
1640 break; 1562 break;
1641 1563
1642 case 78: 1564 case 71:
1643 1565
1644 { 1566 {
1645 current_entry->sym->help = (yyvsp[0].string); 1567 current_entry->sym->help = (yyvsp[0].string);
1646;} 1568;}
1647 break; 1569 break;
1648 1570
1649 case 82: 1571 case 75:
1650 1572
1651 { 1573 {
1652 menu_add_dep((yyvsp[-1].expr)); 1574 menu_add_dep((yyvsp[-1].expr));
@@ -1654,7 +1576,7 @@ yyreduce:
1654;} 1576;}
1655 break; 1577 break;
1656 1578
1657 case 83: 1579 case 76:
1658 1580
1659 { 1581 {
1660 menu_add_dep((yyvsp[-1].expr)); 1582 menu_add_dep((yyvsp[-1].expr));
@@ -1662,7 +1584,7 @@ yyreduce:
1662;} 1584;}
1663 break; 1585 break;
1664 1586
1665 case 84: 1587 case 77:
1666 1588
1667 { 1589 {
1668 menu_add_dep((yyvsp[-1].expr)); 1590 menu_add_dep((yyvsp[-1].expr));
@@ -1670,79 +1592,79 @@ yyreduce:
1670;} 1592;}
1671 break; 1593 break;
1672 1594
1673 case 86: 1595 case 79:
1674 1596
1675 { 1597 {
1676 menu_add_prompt(P_PROMPT, (yyvsp[-1].string), (yyvsp[0].expr)); 1598 menu_add_prompt(P_PROMPT, (yyvsp[-1].string), (yyvsp[0].expr));
1677;} 1599;}
1678 break; 1600 break;
1679 1601
1680 case 89: 1602 case 82:
1681 1603
1682 { (yyval.token) = T_ENDMENU; ;} 1604 { (yyval.token) = T_ENDMENU; ;}
1683 break; 1605 break;
1684 1606
1685 case 90: 1607 case 83:
1686 1608
1687 { (yyval.token) = T_ENDCHOICE; ;} 1609 { (yyval.token) = T_ENDCHOICE; ;}
1688 break; 1610 break;
1689 1611
1690 case 91: 1612 case 84:
1691 1613
1692 { (yyval.token) = T_ENDIF; ;} 1614 { (yyval.token) = T_ENDIF; ;}
1693 break; 1615 break;
1694 1616
1695 case 94: 1617 case 87:
1696 1618
1697 { (yyval.expr) = NULL; ;} 1619 { (yyval.expr) = NULL; ;}
1698 break; 1620 break;
1699 1621
1700 case 95: 1622 case 88:
1701 1623
1702 { (yyval.expr) = (yyvsp[0].expr); ;} 1624 { (yyval.expr) = (yyvsp[0].expr); ;}
1703 break; 1625 break;
1704 1626
1705 case 96: 1627 case 89:
1706 1628
1707 { (yyval.expr) = expr_alloc_symbol((yyvsp[0].symbol)); ;} 1629 { (yyval.expr) = expr_alloc_symbol((yyvsp[0].symbol)); ;}
1708 break; 1630 break;
1709 1631
1710 case 97: 1632 case 90:
1711 1633
1712 { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); ;} 1634 { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); ;}
1713 break; 1635 break;
1714 1636
1715 case 98: 1637 case 91:
1716 1638
1717 { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); ;} 1639 { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); ;}
1718 break; 1640 break;
1719 1641
1720 case 99: 1642 case 92:
1721 1643
1722 { (yyval.expr) = (yyvsp[-1].expr); ;} 1644 { (yyval.expr) = (yyvsp[-1].expr); ;}
1723 break; 1645 break;
1724 1646
1725 case 100: 1647 case 93:
1726 1648
1727 { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[0].expr)); ;} 1649 { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[0].expr)); ;}
1728 break; 1650 break;
1729 1651
1730 case 101: 1652 case 94:
1731 1653
1732 { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[-2].expr), (yyvsp[0].expr)); ;} 1654 { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
1733 break; 1655 break;
1734 1656
1735 case 102: 1657 case 95:
1736 1658
1737 { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); ;} 1659 { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
1738 break; 1660 break;
1739 1661
1740 case 103: 1662 case 96:
1741 1663
1742 { (yyval.symbol) = sym_lookup((yyvsp[0].string), 0); free((yyvsp[0].string)); ;} 1664 { (yyval.symbol) = sym_lookup((yyvsp[0].string), 0); free((yyvsp[0].string)); ;}
1743 break; 1665 break;
1744 1666
1745 case 104: 1667 case 97:
1746 1668
1747 { (yyval.symbol) = sym_lookup((yyvsp[0].string), 1); free((yyvsp[0].string)); ;} 1669 { (yyval.symbol) = sym_lookup((yyvsp[0].string), 1); free((yyvsp[0].string)); ;}
1748 break; 1670 break;
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 43021d436baf..1211781675b8 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -43,43 +43,38 @@ static struct menu *current_menu, *current_entry;
43 struct symbol *symbol; 43 struct symbol *symbol;
44 struct expr *expr; 44 struct expr *expr;
45 struct menu *menu; 45 struct menu *menu;
46 struct kconf_id *id;
46} 47}
47 48
48%token T_MAINMENU 49%token <id>T_MAINMENU
49%token T_MENU 50%token <id>T_MENU
50%token T_ENDMENU 51%token <id>T_ENDMENU
51%token T_SOURCE 52%token <id>T_SOURCE
52%token T_CHOICE 53%token <id>T_CHOICE
53%token T_ENDCHOICE 54%token <id>T_ENDCHOICE
54%token T_COMMENT 55%token <id>T_COMMENT
55%token T_CONFIG 56%token <id>T_CONFIG
56%token T_MENUCONFIG 57%token <id>T_MENUCONFIG
57%token T_HELP 58%token <id>T_HELP
58%token <string> T_HELPTEXT 59%token <string> T_HELPTEXT
59%token T_IF 60%token <id>T_IF
60%token T_ENDIF 61%token <id>T_ENDIF
61%token T_DEPENDS 62%token <id>T_DEPENDS
62%token T_REQUIRES 63%token <id>T_REQUIRES
63%token T_OPTIONAL 64%token <id>T_OPTIONAL
64%token T_PROMPT 65%token <id>T_PROMPT
65%token T_DEFAULT 66%token <id>T_TYPE
66%token T_TRISTATE 67%token <id>T_DEFAULT
67%token T_DEF_TRISTATE 68%token <id>T_SELECT
68%token T_BOOLEAN 69%token <id>T_RANGE
69%token T_DEF_BOOLEAN 70%token <id>T_ON
70%token T_STRING
71%token T_INT
72%token T_HEX
73%token <string> T_WORD 71%token <string> T_WORD
74%token <string> T_WORD_QUOTE 72%token <string> T_WORD_QUOTE
75%token T_UNEQUAL 73%token T_UNEQUAL
76%token T_EOF
77%token T_EOL
78%token T_CLOSE_PAREN 74%token T_CLOSE_PAREN
79%token T_OPEN_PAREN 75%token T_OPEN_PAREN
80%token T_ON 76%token T_EOL
81%token T_SELECT 77%token T_EOF
82%token T_RANGE
83 78
84%left T_OR 79%left T_OR
85%left T_AND 80%left T_AND
@@ -160,48 +155,12 @@ config_option_list:
160 | config_option_list T_EOL 155 | config_option_list T_EOL
161; 156;
162 157
163config_option: T_TRISTATE prompt_stmt_opt T_EOL 158config_option: T_TYPE prompt_stmt_opt T_EOL
164{
165 menu_set_type(S_TRISTATE);
166 printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
167};
168
169config_option: T_DEF_TRISTATE expr if_expr T_EOL
170{ 159{
171 menu_add_expr(P_DEFAULT, $2, $3); 160 menu_set_type($1->stype);
172 menu_set_type(S_TRISTATE); 161 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
173 printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno()); 162 zconf_curname(), zconf_lineno(),
174}; 163 $1->stype);
175
176config_option: T_BOOLEAN prompt_stmt_opt T_EOL
177{
178 menu_set_type(S_BOOLEAN);
179 printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
180};
181
182config_option: T_DEF_BOOLEAN expr if_expr T_EOL
183{
184 menu_add_expr(P_DEFAULT, $2, $3);
185 menu_set_type(S_BOOLEAN);
186 printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
187};
188
189config_option: T_INT prompt_stmt_opt T_EOL
190{
191 menu_set_type(S_INT);
192 printd(DEBUG_PARSE, "%s:%d:int\n", zconf_curname(), zconf_lineno());
193};
194
195config_option: T_HEX prompt_stmt_opt T_EOL
196{
197 menu_set_type(S_HEX);
198 printd(DEBUG_PARSE, "%s:%d:hex\n", zconf_curname(), zconf_lineno());
199};
200
201config_option: T_STRING prompt_stmt_opt T_EOL
202{
203 menu_set_type(S_STRING);
204 printd(DEBUG_PARSE, "%s:%d:string\n", zconf_curname(), zconf_lineno());
205}; 164};
206 165
207config_option: T_PROMPT prompt if_expr T_EOL 166config_option: T_PROMPT prompt if_expr T_EOL
@@ -213,7 +172,11 @@ config_option: T_PROMPT prompt if_expr T_EOL
213config_option: T_DEFAULT expr if_expr T_EOL 172config_option: T_DEFAULT expr if_expr T_EOL
214{ 173{
215 menu_add_expr(P_DEFAULT, $2, $3); 174 menu_add_expr(P_DEFAULT, $2, $3);
216 printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); 175 if ($1->stype != S_UNKNOWN)
176 menu_set_type($1->stype);
177 printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
178 zconf_curname(), zconf_lineno(),
179 $1->stype);
217}; 180};
218 181
219config_option: T_SELECT T_WORD if_expr T_EOL 182config_option: T_SELECT T_WORD if_expr T_EOL
@@ -275,16 +238,15 @@ choice_option: T_PROMPT prompt if_expr T_EOL
275 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); 238 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
276}; 239};
277 240
278choice_option: T_TRISTATE prompt_stmt_opt T_EOL 241choice_option: T_TYPE prompt_stmt_opt T_EOL
279{
280 menu_set_type(S_TRISTATE);
281 printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
282};
283
284choice_option: T_BOOLEAN prompt_stmt_opt T_EOL
285{ 242{
286 menu_set_type(S_BOOLEAN); 243 if ($1->stype == S_BOOLEAN || $1->stype == S_TRISTATE) {
287 printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno()); 244 menu_set_type($1->stype);
245 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
246 zconf_curname(), zconf_lineno(),
247 $1->stype);
248 } else
249 YYERROR;
288}; 250};
289 251
290choice_option: T_OPTIONAL T_EOL 252choice_option: T_OPTIONAL T_EOL
@@ -295,8 +257,12 @@ choice_option: T_OPTIONAL T_EOL
295 257
296choice_option: T_DEFAULT T_WORD if_expr T_EOL 258choice_option: T_DEFAULT T_WORD if_expr T_EOL
297{ 259{
298 menu_add_symbol(P_DEFAULT, sym_lookup($2, 0), $3); 260 if ($1->stype == S_UNKNOWN) {
299 printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); 261 menu_add_symbol(P_DEFAULT, sym_lookup($2, 0), $3);
262 printd(DEBUG_PARSE, "%s:%d:default\n",
263 zconf_curname(), zconf_lineno());
264 } else
265 YYERROR;
300}; 266};
301 267
302choice_block: 268choice_block: