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.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 79cb983..c3f1bd0 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -379,97 +379,97 @@ depends: T_DEPENDS T_ON expr
379prompt_stmt_opt: 379prompt_stmt_opt:
380 /* empty */ 380 /* empty */
381 | prompt 381 | prompt
382{ 382{
383 menu_add_prop(P_PROMPT, $1, NULL, NULL); 383 menu_add_prop(P_PROMPT, $1, NULL, NULL);
384} 384}
385 | prompt T_IF expr 385 | prompt T_IF expr
386{ 386{
387 menu_add_prop(P_PROMPT, $1, NULL, $3); 387 menu_add_prop(P_PROMPT, $1, NULL, $3);
388}; 388};
389 389
390 prompt: T_WORD 390 prompt: T_WORD
391 | T_STRING 391 | T_STRING
392; 392;
393 393
394 end: T_ENDMENU { $$ = T_ENDMENU; } 394 end: T_ENDMENU { $$ = T_ENDMENU; }
395 | T_ENDCHOICE { $$ = T_ENDCHOICE; } 395 | T_ENDCHOICE { $$ = T_ENDCHOICE; }
396 | T_ENDIF { $$ = T_ENDIF; } 396 | T_ENDIF { $$ = T_ENDIF; }
397; 397;
398 398
399nl_or_eof: 399nl_or_eof:
400 T_EOL | T_EOF; 400 T_EOL | T_EOF;
401 401
402 if_expr: /* empty */ { $$ = NULL; } 402 if_expr: /* empty */ { $$ = NULL; }
403 | T_IF expr { $$ = $2; } 403 | T_IF expr { $$ = $2; }
404; 404;
405 405
406 expr: symbol { $$ = expr_alloc_symbol($1); } 406 expr: symbol { $$ = expr_alloc_symbol($1); }
407 | symbol T_EQUAL symbol { $$ = expr_alloc_comp(E_EQUAL, $1, $3); } 407 | symbol T_EQUAL symbol { $$ = expr_alloc_comp(E_EQUAL, $1, $3); }
408 | symbol T_UNEQUAL symbol { $$ = expr_alloc_comp(E_UNEQUAL, $1, $3); } 408 | symbol T_UNEQUAL symbol { $$ = expr_alloc_comp(E_UNEQUAL, $1, $3); }
409 | T_OPEN_PAREN expr T_CLOSE_PAREN{ $$ = $2; } 409 | T_OPEN_PAREN expr T_CLOSE_PAREN{ $$ = $2; }
410 | T_NOT expr { $$ = expr_alloc_one(E_NOT, $2); } 410 | T_NOT expr { $$ = expr_alloc_one(E_NOT, $2); }
411 | expr T_OR expr { $$ = expr_alloc_two(E_OR, $1, $3); } 411 | expr T_OR expr { $$ = expr_alloc_two(E_OR, $1, $3); }
412 | expr T_AND expr { $$ = expr_alloc_two(E_AND, $1, $3); } 412 | expr T_AND expr { $$ = expr_alloc_two(E_AND, $1, $3); }
413; 413;
414 414
415 symbol: T_WORD{ $$ = sym_lookup($1, 0); free($1); } 415 symbol: T_WORD{ $$ = sym_lookup($1, 0); free($1); }
416 | T_STRING{ $$ = sym_lookup($1, 1); free($1); } 416 | T_STRING{ $$ = sym_lookup($1, 1); free($1); }
417; 417;
418 418
419%% 419%%
420 420
421void conf_parse(const char *name) 421void conf_parse(const char *name)
422{ 422{
423 zconf_initscan(name); 423 zconf_initscan(name);
424 424
425 sym_init(); 425 sym_init();
426 menu_init(); 426 menu_init();
427 rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL); 427 rootmenu.prompt = menu_add_prop(P_MENU, "Configuration", NULL, NULL);
428 428
429 //zconfdebug = 1; 429 //zconfdebug = 1;
430 zconfparse(); 430 zconfparse();
431 if (zconfnerrs) 431 if (zconfnerrs)
432 exit(1); 432 exit(1);
433 menu_finalize(&rootmenu); 433 menu_finalize(&rootmenu);
434 434
435 modules_sym = sym_lookup("MODULES", 0); 435 modules_sym = sym_lookup("MODULES", 0);
436 436
437 sym_change_count = 1; 437 sym_change_count = 1;
438} 438}
439 439
440const char *zconf_tokenname(int token) 440const char *zconf_tokenname(int token)
441{ 441{
442 switch (token) { 442 switch (token) {
443 case T_MENU: return "menu"; 443 case T_MENU: return "menu";
444 case T_ENDMENU: return "endmenu"; 444 case T_ENDMENU: return "endmenu";
445 case T_CHOICE: return "choice"; 445 case T_CHOICE: return "choice";
446 case T_ENDCHOICE:return "endchoice"; 446 case T_ENDCHOICE:return "endchoice";
447 case T_IF: return "if"; 447 case T_IF: return "if";
448 case T_ENDIF: return "endif"; 448 case T_ENDIF: return "endif";
449 } 449 }
450 return "<token>"; 450 return "<token>";
451} 451}
452 452
453static bool zconf_endtoken(int token, int starttoken, int endtoken) 453static bool zconf_endtoken(int token, int starttoken, int endtoken)
454{ 454{
455 if (token != endtoken) { 455 if (token != endtoken) {
456 zconfprint("unexpected '%s' within %s block", zconf_tokenname(token), zconf_tokenname(starttoken)); 456 zconfprint("unexpected '%s' within %s block", zconf_tokenname(token), zconf_tokenname(starttoken));
457 zconfnerrs++; 457 zconfnerrs++;
458 return false; 458 return false;
459 } 459 }
460 if (current_menu->file != current_file) { 460 if (current_menu->file != current_file) {
461 zconfprint("'%s' in different file than '%s'", zconf_tokenname(token), zconf_tokenname(starttoken)); 461 zconfprint("'%s' in different file than '%s'", zconf_tokenname(token), zconf_tokenname(starttoken));
462 zconfprint("location of the '%s'", zconf_tokenname(starttoken)); 462 zconfprint("location of the '%s'", zconf_tokenname(starttoken));
463 zconfnerrs++; 463 zconfnerrs++;
464 return false; 464 return false;
465 } 465 }
466 return true; 466 return true;
467} 467}
468 468
469static void zconfprint(const char *err, ...) 469static void zconfprint(const char *err, ...)
470{ 470{
471 va_list ap; 471 va_list ap;
472 472
473 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno()); 473 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
474 va_start(ap, err); 474 va_start(ap, err);
475 vfprintf(stderr, err, ap); 475 vfprintf(stderr, err, ap);