⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zconf.tab.c_shipped

📁 busybox最新版的源码:学习和应用的好东东,多的不说了,大家看后再说吧
💻 C_SHIPPED
📖 第 1 页 / 共 4 页
字号:
	menu_add_prompt(P_PROMPT, (yyvsp[-1].string), (yyvsp[0].expr));;}    break;  case 89:    { (yyval.id) = (yyvsp[-1].id); ;}    break;  case 90:    { (yyval.id) = (yyvsp[-1].id); ;}    break;  case 91:    { (yyval.id) = (yyvsp[-1].id); ;}    break;  case 94:    { (yyval.expr) = NULL; ;}    break;  case 95:    { (yyval.expr) = (yyvsp[0].expr); ;}    break;  case 96:    { (yyval.expr) = expr_alloc_symbol((yyvsp[0].symbol)); ;}    break;  case 97:    { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); ;}    break;  case 98:    { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); ;}    break;  case 99:    { (yyval.expr) = (yyvsp[-1].expr); ;}    break;  case 100:    { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[0].expr)); ;}    break;  case 101:    { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}    break;  case 102:    { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}    break;  case 103:    { (yyval.symbol) = sym_lookup((yyvsp[0].string), 0); free((yyvsp[0].string)); ;}    break;  case 104:    { (yyval.symbol) = sym_lookup((yyvsp[0].string), 1); free((yyvsp[0].string)); ;}    break;    }/* Line 1037 of yacc.c.  */  yyvsp -= yylen;  yyssp -= yylen;  YY_STACK_PRINT (yyss, yyssp);  *++yyvsp = yyval;  /* Now `shift' the result of the reduction.  Determine what state     that goes to, based on the state we popped back to and the rule     number reduced by.  */  yyn = yyr1[yyn];  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)    yystate = yytable[yystate];  else    yystate = yydefgoto[yyn - YYNTOKENS];  goto yynewstate;/*------------------------------------.| yyerrlab -- here on detecting error |`------------------------------------*/yyerrlab:  /* If not already recovering from an error, report this error.  */  if (!yyerrstatus)    {      ++yynerrs;#if YYERROR_VERBOSE      yyn = yypact[yystate];      if (YYPACT_NINF < yyn && yyn < YYLAST)	{	  YYSIZE_T yysize = 0;	  int yytype = YYTRANSLATE (yychar);	  const char* yyprefix;	  char *yymsg;	  int yyx;	  /* Start YYX at -YYN if negative to avoid negative indexes in	     YYCHECK.  */	  int yyxbegin = yyn < 0 ? -yyn : 0;	  /* Stay within bounds of both yycheck and yytname.  */	  int yychecklim = YYLAST - yyn;	  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;	  int yycount = 0;	  yyprefix = ", expecting ";	  for (yyx = yyxbegin; yyx < yyxend; ++yyx)	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)	      {		yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);		yycount += 1;		if (yycount == 5)		  {		    yysize = 0;		    break;		  }	      }	  yysize += (sizeof ("syntax error, unexpected ")		     + yystrlen (yytname[yytype]));	  yymsg = (char *) YYSTACK_ALLOC (yysize);	  if (yymsg != 0)	    {	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");	      yyp = yystpcpy (yyp, yytname[yytype]);	      if (yycount < 5)		{		  yyprefix = ", expecting ";		  for (yyx = yyxbegin; yyx < yyxend; ++yyx)		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)		      {			yyp = yystpcpy (yyp, yyprefix);			yyp = yystpcpy (yyp, yytname[yyx]);			yyprefix = " or ";		      }		}	      yyerror (yymsg);	      YYSTACK_FREE (yymsg);	    }	  else	    yyerror ("syntax error; also virtual memory exhausted");	}      else#endif /* YYERROR_VERBOSE */	yyerror ("syntax error");    }  if (yyerrstatus == 3)    {      /* If just tried and failed to reuse look-ahead token after an	 error, discard it.  */      if (yychar <= YYEOF)        {          /* If at end of input, pop the error token,	     then the rest of the stack, then return failure.  */	  if (yychar == YYEOF)	     for (;;)	       {		 YYPOPSTACK;		 if (yyssp == yyss)		   YYABORT;		 yydestruct ("Error: popping",                             yystos[*yyssp], yyvsp);	       }        }      else	{	  yydestruct ("Error: discarding", yytoken, &yylval);	  yychar = YYEMPTY;	}    }  /* Else will try to reuse look-ahead token after shifting the error     token.  */  goto yyerrlab1;/*---------------------------------------------------.| yyerrorlab -- error raised explicitly by YYERROR.  |`---------------------------------------------------*/yyerrorlab:#ifdef __GNUC__  /* Pacify GCC when the user code never invokes YYERROR and the label     yyerrorlab therefore never appears in user code.  */  if (0)     goto yyerrorlab;#endifyyvsp -= yylen;  yyssp -= yylen;  yystate = *yyssp;  goto yyerrlab1;/*-------------------------------------------------------------.| yyerrlab1 -- common code for both syntax error and YYERROR.  |`-------------------------------------------------------------*/yyerrlab1:  yyerrstatus = 3;	/* Each real token shifted decrements this.  */  for (;;)    {      yyn = yypact[yystate];      if (yyn != YYPACT_NINF)	{	  yyn += YYTERROR;	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)	    {	      yyn = yytable[yyn];	      if (0 < yyn)		break;	    }	}      /* Pop the current state because it cannot handle the error token.  */      if (yyssp == yyss)	YYABORT;      yydestruct ("Error: popping", yystos[yystate], yyvsp);      YYPOPSTACK;      yystate = *yyssp;      YY_STACK_PRINT (yyss, yyssp);    }  if (yyn == YYFINAL)    YYACCEPT;  *++yyvsp = yylval;  /* Shift the error token. */  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);  yystate = yyn;  goto yynewstate;/*-------------------------------------.| yyacceptlab -- YYACCEPT comes here.  |`-------------------------------------*/yyacceptlab:  yyresult = 0;  goto yyreturn;/*-----------------------------------.| yyabortlab -- YYABORT comes here.  |`-----------------------------------*/yyabortlab:  yydestruct ("Error: discarding lookahead",              yytoken, &yylval);  yychar = YYEMPTY;  yyresult = 1;  goto yyreturn;#ifndef yyoverflow/*----------------------------------------------.| yyoverflowlab -- parser overflow comes here.  |`----------------------------------------------*/yyoverflowlab:  yyerror ("parser stack overflow");  yyresult = 2;  /* Fall through.  */#endifyyreturn:#ifndef yyoverflow  if (yyss != yyssa)    YYSTACK_FREE (yyss);#endif  return yyresult;}void conf_parse(const char *name){	struct symbol *sym;	int i;	zconf_initscan(name);	sym_init();	menu_init();	modules_sym = sym_lookup("MODULES", 0);	rootmenu.prompt = menu_add_prompt(P_MENU, "Busybox Configuration", NULL);#if YYDEBUG	if (getenv("ZCONF_DEBUG"))		zconfdebug = 1;#endif	zconfparse();	if (zconfnerrs)		exit(1);	menu_finalize(&rootmenu);	for_all_symbols(i, sym) {		sym_check_deps(sym);        }	sym_change_count = 1;}const char *zconf_tokenname(int token){	switch (token) {	case T_MENU:		return "menu";	case T_ENDMENU:		return "endmenu";	case T_CHOICE:		return "choice";	case T_ENDCHOICE:	return "endchoice";	case T_IF:		return "if";	case T_ENDIF:		return "endif";	case T_DEPENDS:		return "depends";	}	return "<token>";}static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken){	if (id->token != endtoken) {		zconf_error("unexpected '%s' within %s block",			kconf_id_strings + id->name, zconf_tokenname(starttoken));		zconfnerrs++;		return false;	}	if (current_menu->file != current_file) {		zconf_error("'%s' in different file than '%s'",			kconf_id_strings + id->name, zconf_tokenname(starttoken));		fprintf(stderr, "%s:%d: location of the '%s'\n",			current_menu->file->name, current_menu->lineno,			zconf_tokenname(starttoken));		zconfnerrs++;		return false;	}	return true;}static void zconfprint(const char *err, ...){	va_list ap;	fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());	va_start(ap, err);	vfprintf(stderr, err, ap);	va_end(ap);	fprintf(stderr, "\n");}static void zconf_error(const char *err, ...){	va_list ap;	zconfnerrs++;	fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());	va_start(ap, err);	vfprintf(stderr, err, ap);	va_end(ap);	fprintf(stderr, "\n");}static void zconferror(const char *err){#if YYDEBUG	fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);#endif}void print_quoted_string(FILE *out, const char *str){	const char *p;	int len;	putc('"', out);	while ((p = strchr(str, '"'))) {		len = p - str;		if (len)			fprintf(out, "%.*s", len, str);		fputs("\\\"", out);		str = p + 1;	}	fputs(str, out);	putc('"', out);}void print_symbol(FILE *out, struct menu *menu){	struct symbol *sym = menu->sym;	struct property *prop;	if (sym_is_choice(sym))		fprintf(out, "choice\n");	else		fprintf(out, "config %s\n", sym->name);	switch (sym->type) {	case S_BOOLEAN:		fputs("  boolean\n", out);		break;	case S_TRISTATE:		fputs("  tristate\n", out);		break;	case S_STRING:		fputs("  string\n", out);		break;	case S_INT:		fputs("  integer\n", out);		break;	case S_HEX:		fputs("  hex\n", out);		break;	default:		fputs("  ???\n", out);		break;	}	for (prop = sym->prop; prop; prop = prop->next) {		if (prop->menu != menu)			continue;		switch (prop->type) {		case P_PROMPT:			fputs("  prompt ", out);			print_quoted_string(out, prop->text);			if (!expr_is_yes(prop->visible.expr)) {				fputs(" if ", out);				expr_fprint(prop->visible.expr, out);			}			fputc('\n', out);			break;		case P_DEFAULT:			fputs( "  default ", out);			expr_fprint(prop->expr, out);			if (!expr_is_yes(prop->visible.expr)) {				fputs(" if ", out);				expr_fprint(prop->visible.expr, out);			}			fputc('\n', out);			break;		case P_CHOICE:			fputs("  #choice value\n", out);			break;		default:			fprintf(out, "  unknown prop %d!\n", prop->type);			break;		}	}	if (sym->help) {		int len = strlen(sym->help);		while (sym->help[--len] == '\n')			sym->help[len] = 0;		fprintf(out, "  help\n%s\n", sym->help);	}	fputc('\n', out);}void zconfdump(FILE *out){	struct property *prop;	struct symbol *sym;	struct menu *menu;	menu = rootmenu.list;	while (menu) {		if ((sym = menu->sym))			print_symbol(out, menu);		else if ((prop = menu->prompt)) {			switch (prop->type) {			case P_COMMENT:				fputs("\ncomment ", out);				print_quoted_string(out, prop->text);				fputs("\n", out);				break;			case P_MENU:				fputs("\nmenu ", out);				print_quoted_string(out, prop->text);				fputs("\n", out);				break;			default:				;			}			if (!expr_is_yes(prop->visible.expr)) {				fputs("  depends ", out);				expr_fprint(prop->visible.expr, out);				fputc('\n', out);			}			fputs("\n", out);		}		if (menu->list)			menu = menu->list;		else if (menu->next)			menu = menu->next;		else while ((menu = menu->parent)) {			if (menu->prompt && menu->prompt->type == P_MENU)				fputs("\nendmenu\n", out);			if (menu->next) {				menu = menu->next;				break;			}		}	}}#include "lex.zconf.c"#include "util.c"#include "confdata.c"#include "expr.c"#include "symbol.c"#include "menu.c"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -