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

📄 fcl-parser.cc

📁 parse fuzzy contrl language file
💻 CC
📖 第 1 页 / 共 3 页
字号:
	yytoken = yytranslate_ (yychar);	YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);      }    /* If the proper action on seeing token YYTOKEN is to reduce or to       detect an error, take that action.  */    yyn += yytoken;    if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)      goto yydefault;    /* Reduce or error.  */    yyn = yytable_[yyn];    if (yyn <= 0)      {	if (yyn == 0 || yyn == yytable_ninf_)	goto yyerrlab;	yyn = -yyn;	goto yyreduce;      }    /* Accept?  */    if (yyn == yyfinal_)      goto yyacceptlab;    /* Shift the look-ahead token.  */    YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);    /* Discard the token being shifted unless it is eof.  */    if (yychar != yyeof_)      yychar = yyempty_;    yysemantic_stack_.push (yylval);    yylocation_stack_.push (yylloc);    /* Count tokens shifted since error; after three, turn off error       status.  */    if (yyerrstatus_)      --yyerrstatus_;    yystate = yyn;    goto yynewstate;  /*-----------------------------------------------------------.  | yydefault -- do the default action for the current state.  |  `-----------------------------------------------------------*/  yydefault:    yyn = yydefact_[yystate];    if (yyn == 0)      goto yyerrlab;    goto yyreduce;  /*-----------------------------.  | yyreduce -- Do a reduction.  |  `-----------------------------*/  yyreduce:    yylen = yyr2_[yyn];    /* If YYLEN is nonzero, implement the default value of the action:       `$$ = $1'.  Otherwise, use the top of the stack.       Otherwise, the following line sets YYVAL to garbage.       This behavior is undocumented and Bison       users should not rely upon it.  */    if (yylen)      yyval = yysemantic_stack_[yylen - 1];    else      yyval = yysemantic_stack_[0];    {      slice<location_type, location_stack_type> slice (yylocation_stack_, yylen);      YYLLOC_DEFAULT (yyloc, slice, yylen);    }    YY_REDUCE_PRINT (yyn);    switch (yyn)      {	  case 3:#line 7549 "../../doc/bison.texinfo"    {		std::cout << "Creacion satisfactoria de modelo difuso:" << std::endl;	;}    break;  case 5:#line 7560 "../../doc/bison.texinfo"    {		std::string fuzzyName = *(yysemantic_stack_[(2) - (2)].sval);		std::cout << "Creando el modelo difuso: " << fuzzyName << endl;			;}    break;  case 10:#line 7580 "../../doc/bison.texinfo"    {		std::string varName = *(yysemantic_stack_[(4) - (1)].sval);	;}    break;  case 13:#line 7593 "../../doc/bison.texinfo"    {		std::string varName = *(yysemantic_stack_[(4) - (1)].sval);	;}    break;  case 17:#line 7608 "../../doc/bison.texinfo"    {		string varName = *(yysemantic_stack_[(2) - (2)].sval);	;}    break;    /* Line 675 of lalr1.cc.  */#line 446 "fcl-parser.cc"	default: break;      }    YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);    yypop_ (yylen);    yylen = 0;    YY_STACK_PRINT ();    yysemantic_stack_.push (yyval);    yylocation_stack_.push (yyloc);    /* Shift the result of the reduction.  */    yyn = yyr1_[yyn];    yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];    if (0 <= yystate && yystate <= yylast_	&& yycheck_[yystate] == yystate_stack_[0])      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_;	error (yylloc, yysyntax_error_ (yystate, yytoken));      }    yyerror_range[0] = yylloc;    if (yyerrstatus_ == 3)      {	/* If just tried and failed to reuse look-ahead token after an	 error, discard it.  */	if (yychar <= yyeof_)	  {	  /* Return failure if at end of input.  */	  if (yychar == yyeof_)	    YYABORT;	  }	else	  {	    yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);	    yychar = yyempty_;	  }      }    /* Else will try to reuse look-ahead token after shifting the error       token.  */    goto yyerrlab1;  /*---------------------------------------------------.  | yyerrorlab -- error raised explicitly by YYERROR.  |  `---------------------------------------------------*/  yyerrorlab:    /* Pacify compilers like GCC when the user code never invokes       YYERROR and the label yyerrorlab therefore never appears in user       code.  */    if (false)      goto yyerrorlab;    yyerror_range[0] = yylocation_stack_[yylen - 1];    /* Do not reclaim the symbols of the rule which action triggered       this YYERROR.  */    yypop_ (yylen);    yylen = 0;    yystate = yystate_stack_[0];    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 (yystate_stack_.height () == 1)	YYABORT;	yyerror_range[0] = yylocation_stack_[0];	yydestruct_ ("Error: popping",		     yystos_[yystate],		     &yysemantic_stack_[0], &yylocation_stack_[0]);	yypop_ ();	yystate = yystate_stack_[0];	YY_STACK_PRINT ();      }    if (yyn == yyfinal_)      goto yyacceptlab;    yyerror_range[1] = yylloc;    // Using YYLLOC is tempting, but would change the location of    // the look-ahead.  YYLOC is available though.    YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);    yysemantic_stack_.push (yylval);    yylocation_stack_.push (yyloc);    /* Shift the error token.  */    YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],		   &yysemantic_stack_[0], &yylocation_stack_[0]);    yystate = yyn;    goto yynewstate;    /* Accept.  */  yyacceptlab:    yyresult = 0;    goto yyreturn;    /* Abort.  */  yyabortlab:    yyresult = 1;    goto yyreturn;  yyreturn:    if (yychar != yyeof_ && yychar != yyempty_)      yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);    /* Do not reclaim the symbols of the rule which action triggered       this YYABORT or YYACCEPT.  */    yypop_ (yylen);    while (yystate_stack_.height () != 1)      {	yydestruct_ ("Cleanup: popping",		   yystos_[yystate_stack_[0]],		   &yysemantic_stack_[0],		   &yylocation_stack_[0]);	yypop_ ();      }    return yyresult;  }  // Generate an error message.  std::string  fcl_parser::yysyntax_error_ (int yystate, int tok)  {    std::string res;    YYUSE (yystate);#if YYERROR_VERBOSE    int yyn = yypact_[yystate];    if (yypact_ninf_ < yyn && yyn <= yylast_)      {	/* 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 + 1;	int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;	int count = 0;	for (int x = yyxbegin; x < yyxend; ++x)	  if (yycheck_[x + yyn] == x && x != yyterror_)	    ++count;	// FIXME: This method of building the message is not compatible	// with internationalization.  It should work like yacc.c does it.	// That is, first build a string that looks like this:	// "syntax error, unexpected %s or %s or %s"	// Then, invoke YY_ on this string.	// Finally, use the string as a format to output	// yytname_[tok], etc.	// Until this gets fixed, this message appears in English only.	res = "syntax error, unexpected ";	res += yytnamerr_ (yytname_[tok]);	if (count < 5)	  {	    count = 0;	    for (int x = yyxbegin; x < yyxend; ++x)	      if (yycheck_[x + yyn] == x && x != yyterror_)		{		  res += (!count++) ? ", expecting " : " or ";		  res += yytnamerr_ (yytname_[x]);		}	  }      }    else#endif      res = YY_("syntax error");    return res;  }  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing     STATE-NUM.  */  const signed char fcl_parser::yypact_ninf_ = -51;  const signed char  fcl_parser::yypact_[] =  {       -51,    24,   -51,   -26,    34,   -51,   -51,   -51,    36,     0,      39,     8,    -7,   -51,     3,   -51,    26,   -51,    14,    45,     -51,   -51,     6,   -51,    -8,   -51,    12,    10,    33,    33,      11,   -51,   -51,   -51,    15,    -6,   -51,    20,    46,    46,     -23,    23,   -51,   -51,    18,    17,    16,   -51,    19,    22,      25,    42,    27,    28,    30,   -51,   -51,    31,    55,   -14,     -11,    32,    44,   -51,    29,   -39,    -2,   -51,   -51,   -51,     -51,    35,   -51,   -51,   -51,    37,    13,    40,    49,    38,      41,   -51,    43,   -51,    47,   -51,   -51,   -51,   -51,   -51,

⌨️ 快捷键说明

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