summaryrefslogtreecommitdiff
path: root/scripts/kconfig/zconf.y
Unidiff
Diffstat (limited to 'scripts/kconfig/zconf.y') (more/less context) (ignore whitespace changes)
-rw-r--r--scripts/kconfig/zconf.y6
1 files changed, 2 insertions, 4 deletions
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index c3f1bd0..996b10a 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -182,115 +182,113 @@ choice: T_CHOICE
182 sym->flags |= SYMBOL_CHOICE; 182 sym->flags |= SYMBOL_CHOICE;
183 menu_add_entry(sym); 183 menu_add_entry(sym);
184 menu_add_prop(P_CHOICE, NULL, NULL, NULL); 184 menu_add_prop(P_CHOICE, NULL, NULL, NULL);
185 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno()); 185 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
186}; 186};
187 187
188choice_entry: choice T_EOL choice_option_list 188choice_entry: choice T_EOL choice_option_list
189{ 189{
190 menu_end_entry(); 190 menu_end_entry();
191 menu_add_menu(); 191 menu_add_menu();
192}; 192};
193 193
194choice_end: end 194choice_end: end
195{ 195{
196 if (zconf_endtoken($1, T_CHOICE, T_ENDCHOICE)) { 196 if (zconf_endtoken($1, T_CHOICE, T_ENDCHOICE)) {
197 menu_end_menu(); 197 menu_end_menu();
198 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno()); 198 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
199 } 199 }
200}; 200};
201 201
202choice_stmt: 202choice_stmt:
203 choice_entry choice_block choice_end T_EOL 203 choice_entry choice_block choice_end T_EOL
204 | choice_entry choice_block 204 | choice_entry choice_block
205{ 205{
206 printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno); 206 printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno);
207 zconfnerrs++; 207 zconfnerrs++;
208}; 208};
209 209
210choice_option_list: 210choice_option_list:
211 /* empty */ 211 /* empty */
212 | choice_option_list choice_option T_EOL 212 | choice_option_list choice_option T_EOL
213 | choice_option_list depends T_EOL 213 | choice_option_list depends T_EOL
214 | choice_option_list help 214 | choice_option_list help
215 | choice_option_list T_EOL 215 | choice_option_list T_EOL
216; 216;
217 217
218choice_option: T_PROMPT prompt if_expr 218choice_option: T_PROMPT prompt if_expr
219{ 219{
220 menu_add_prop(P_PROMPT, $2, NULL, $3); 220 menu_add_prop(P_PROMPT, $2, NULL, $3);
221 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); 221 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
222}; 222};
223 223
224choice_option: T_OPTIONAL 224choice_option: T_OPTIONAL
225{ 225{
226 current_entry->sym->flags |= SYMBOL_OPTIONAL; 226 current_entry->sym->flags |= SYMBOL_OPTIONAL;
227 printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno()); 227 printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
228}; 228};
229 229
230choice_option: T_DEFAULT symbol 230choice_option: T_DEFAULT symbol if_expr
231{ 231{
232 menu_add_prop(P_DEFAULT, NULL, $2, NULL); 232 menu_add_prop(P_DEFAULT, NULL, $2, $3);
233 //current_choice->prop->def = $2;
234 printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); 233 printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
235}; 234};
236 235
237choice_block: 236choice_block:
238 /* empty */ 237 /* empty */
239 | choice_block common_block 238 | choice_block common_block
240; 239;
241 240
242/* if entry */ 241/* if entry */
243 242
244if: T_IF expr 243if: T_IF expr
245{ 244{
246 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); 245 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
247 menu_add_entry(NULL); 246 menu_add_entry(NULL);
248 //current_entry->prompt = menu_add_prop(T_IF, NULL, NULL, $2);
249 menu_add_dep($2); 247 menu_add_dep($2);
250 menu_end_entry(); 248 menu_end_entry();
251 menu_add_menu(); 249 menu_add_menu();
252}; 250};
253 251
254if_end: end 252if_end: end
255{ 253{
256 if (zconf_endtoken($1, T_IF, T_ENDIF)) { 254 if (zconf_endtoken($1, T_IF, T_ENDIF)) {
257 menu_end_menu(); 255 menu_end_menu();
258 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno()); 256 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
259 } 257 }
260}; 258};
261 259
262if_stmt: 260if_stmt:
263 if T_EOL if_block if_end T_EOL 261 if T_EOL if_block if_end T_EOL
264 | if T_EOL if_block 262 | if T_EOL if_block
265{ 263{
266 printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno); 264 printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno);
267 zconfnerrs++; 265 zconfnerrs++;
268}; 266};
269 267
270if_block: 268if_block:
271 /* empty */ 269 /* empty */
272 | if_block common_block 270 | if_block common_block
273 | if_block menu_stmt 271 | if_block menu_stmt
274 | if_block choice_stmt 272 | if_block choice_stmt
275; 273;
276 274
277/* menu entry */ 275/* menu entry */
278 276
279menu: T_MENU prompt 277menu: T_MENU prompt
280{ 278{
281 menu_add_entry(NULL); 279 menu_add_entry(NULL);
282 menu_add_prop(P_MENU, $2, NULL, NULL); 280 menu_add_prop(P_MENU, $2, NULL, NULL);
283 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); 281 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
284}; 282};
285 283
286menu_entry: menu T_EOL depends_list 284menu_entry: menu T_EOL depends_list
287{ 285{
288 menu_end_entry(); 286 menu_end_entry();
289 menu_add_menu(); 287 menu_add_menu();
290}; 288};
291 289
292menu_end: end 290menu_end: end
293{ 291{
294 if (zconf_endtoken($1, T_MENU, T_ENDMENU)) { 292 if (zconf_endtoken($1, T_MENU, T_ENDMENU)) {
295 menu_end_menu(); 293 menu_end_menu();
296 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno()); 294 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());