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

📄 _vs1.0_parser.cpp

📁 使用stl技术,(还没看,是听说的)
💻 CPP
📖 第 1 页 / 共 4 页
字号:
case 30:
#line 314 "vs1.0_grammar.y"
{
		yyval.inst = new VS10Inst( get_linenum(), yyvsp[-3].ival, yyvsp[-2].reg, yyvsp[0].reg );
	;
    break;}
case 31:
#line 320 "vs1.0_grammar.y"
{
		yyval.inst = new VS10Inst( get_linenum(), yyvsp[-3].ival, yyvsp[-2].reg, yyvsp[0].reg );
	;
    break;}
case 32:
#line 326 "vs1.0_grammar.y"
{
		yyval.inst = new VS10Inst( get_linenum(), yyvsp[-5].ival, yyvsp[-4].reg, yyvsp[-2].reg, yyvsp[0].reg );
	;
    break;}
case 33:
#line 333 "vs1.0_grammar.y"
{
		yyval.inst = new VS10Inst( get_linenum(), yyvsp[-7].ival, yyvsp[-6].reg, yyvsp[-4].reg, yyvsp[-2].reg, yyvsp[0].reg );
	;
    break;}
case 34:
#line 339 "vs1.0_grammar.y"
{
		yyval.ival = VS10_MOV;
	;
    break;}
case 35:
#line 343 "vs1.0_grammar.y"
{
		yyval.ival = VS10_LIT;
	;
    break;}
case 36:
#line 349 "vs1.0_grammar.y"
{
	yyval.ival = VS10_RCP;
	;
    break;}
case 37:
#line 353 "vs1.0_grammar.y"
{
	yyval.ival = VS10_RSQ;
	;
    break;}
case 38:
#line 357 "vs1.0_grammar.y"
{
	yyval.ival = VS10_EXP;
	;
    break;}
case 39:
#line 361 "vs1.0_grammar.y"
{
	yyval.ival = VS10_EXPP;
	;
    break;}
case 40:
#line 365 "vs1.0_grammar.y"
{
	yyval.ival = VS10_LOG;
	;
    break;}
case 41:
#line 369 "vs1.0_grammar.y"
{
	yyval.ival = VS10_LOGP;
	;
    break;}
case 42:
#line 375 "vs1.0_grammar.y"
{
	yyval.ival = VS10_FRC;
	;
    break;}
case 43:
#line 381 "vs1.0_grammar.y"
{
	yyval.ival = VS10_MUL;
	;
    break;}
case 44:
#line 385 "vs1.0_grammar.y"
{
	yyval.ival = VS10_ADD;
	;
    break;}
case 45:
#line 389 "vs1.0_grammar.y"
{
	yyval.ival = VS10_DP3;
	;
    break;}
case 46:
#line 393 "vs1.0_grammar.y"
{
	yyval.ival = VS10_DP4;
	;
    break;}
case 47:
#line 397 "vs1.0_grammar.y"
{
	yyval.ival = VS10_DST;
	;
    break;}
case 48:
#line 401 "vs1.0_grammar.y"
{
	yyval.ival = VS10_MIN;
	;
    break;}
case 49:
#line 405 "vs1.0_grammar.y"
{
	yyval.ival = VS10_MAX;
	;
    break;}
case 50:
#line 409 "vs1.0_grammar.y"
{
	yyval.ival = VS10_SLT;
	;
    break;}
case 51:
#line 413 "vs1.0_grammar.y"
{
	yyval.ival = VS10_SGE;
	;
    break;}
case 52:
#line 417 "vs1.0_grammar.y"
{
	yyval.ival = VS10_M3X2;
	;
    break;}
case 53:
#line 421 "vs1.0_grammar.y"
{
	yyval.ival = VS10_M3X3;
	;
    break;}
case 54:
#line 425 "vs1.0_grammar.y"
{
	yyval.ival = VS10_M3X4;
	;
    break;}
case 55:
#line 429 "vs1.0_grammar.y"
{
	yyval.ival = VS10_M4X3;
	;
    break;}
case 56:
#line 433 "vs1.0_grammar.y"
{
	yyval.ival = VS10_M4X4;
	;
    break;}
case 57:
#line 437 "vs1.0_grammar.y"
{
	yyval.ival = VS10_SUB;
	;
    break;}
case 58:
#line 443 "vs1.0_grammar.y"
{
	yyval.ival = VS10_MAD;
	;
    break;}
}

#line 705 "/usr/share/bison/bison.simple"


  yyvsp -= yylen;
  yyssp -= yylen;
#if YYLSP_NEEDED
  yylsp -= yylen;
#endif

#if YYDEBUG
  if (yydebug)
    {
      short *yyssp1 = yyss - 1;
      YYFPRINTF (stderr, "state stack now");
      while (yyssp1 != yyssp)
	YYFPRINTF (stderr, " %d", *++yyssp1);
      YYFPRINTF (stderr, "\n");
    }
#endif

  *++yyvsp = yyval;
#if YYLSP_NEEDED
  *++yylsp = yyloc;
#endif

  /* 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 - YYNTBASE] + *yyssp;
  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTBASE];

  goto yynewstate;


/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;

#ifdef YYERROR_VERBOSE
      yyn = yypact[yystate];

      if (yyn > YYFLAG && yyn < YYLAST)
	{
	  YYSIZE_T yysize = 0;
	  char *yymsg;
	  int yyx, yycount;

	  yycount = 0;
	  /* Start YYX at -YYN if negative to avoid negative indexes in
	     YYCHECK.  */
	  for (yyx = yyn < 0 ? -yyn : 0;
	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
	    if (yycheck[yyx + yyn] == yyx)
	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
	  yysize += yystrlen ("parse error, unexpected ") + 1;
	  yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
	  yymsg = (char *) YYSTACK_ALLOC (yysize);
	  if (yymsg != 0)
	    {
	      char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
	      yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);

	      if (yycount < 5)
		{
		  yycount = 0;
		  for (yyx = yyn < 0 ? -yyn : 0;
		       yyx < (int) (sizeof (yytname) / sizeof (char *));
		       yyx++)
		    if (yycheck[yyx + yyn] == yyx)
		      {
			const char *yyq = ! yycount ? ", expecting " : " or ";
			yyp = yystpcpy (yyp, yyq);
			yyp = yystpcpy (yyp, yytname[yyx]);
			yycount++;
		      }
		}
	      yyerror (yymsg);
	      YYSTACK_FREE (yymsg);
	    }
	  else
	    yyerror ("parse error; also virtual memory exhausted");
	}
      else
#endif /* defined (YYERROR_VERBOSE) */
	yyerror ("parse error");
    }
  goto yyerrlab1;


/*--------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action |
`--------------------------------------------------*/
yyerrlab1:
  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
	 error, discard it.  */

      /* return failure if at end of input */
      if (yychar == YYEOF)
	YYABORT;
      YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
		  yychar, yytname[yychar1]));
      yychar = YYEMPTY;
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */

  yyerrstatus = 3;		/* Each real token shifted decrements this */

  goto yyerrhandle;


/*-------------------------------------------------------------------.
| yyerrdefault -- current state does not do anything special for the |
| error token.                                                       |
`-------------------------------------------------------------------*/
yyerrdefault:
#if 0
  /* This is wrong; only states that explicitly want error tokens
     should shift them.  */

  /* If its default is to accept any token, ok.  Otherwise pop it.  */
  yyn = yydefact[yystate];
  if (yyn)
    goto yydefault;
#endif


/*---------------------------------------------------------------.
| yyerrpop -- pop the current state because it cannot handle the |
| error token                                                    |
`---------------------------------------------------------------*/
yyerrpop:
  if (yyssp == yyss)
    YYABORT;
  yyvsp--;
  yystate = *--yyssp;
#if YYLSP_NEEDED
  yylsp--;
#endif

#if YYDEBUG
  if (yydebug)
    {
      short *yyssp1 = yyss - 1;
      YYFPRINTF (stderr, "Error: state stack now");
      while (yyssp1 != yyssp)
	YYFPRINTF (stderr, " %d", *++yyssp1);
      YYFPRINTF (stderr, "\n");
    }
#endif

/*--------------.
| yyerrhandle.  |
`--------------*/
yyerrhandle:
  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yyerrdefault;

  yyn += YYTERROR;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
    goto yyerrdefault;

  yyn = yytable[yyn];
  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrpop;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrpop;

  if (yyn == YYFINAL)
    YYACCEPT;

  YYDPRINTF ((stderr, "Shifting error token, "));

  *++yyvsp = yylval;
#if YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturn;

/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturn;

/*---------------------------------------------.
| yyoverflowab -- parser overflow comes here.  |
`---------------------------------------------*/
yyoverflowlab:
  yyerror ("parser stack overflow");
  yyresult = 2;
  /* Fall through.  */

yyreturn:
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
  return yyresult;
}
#line 449 "vs1.0_grammar.y"

void yyerror(char* s)
{
    LexError( "Syntax Error.\n" );
    //errors.set(s);
    //errors.set("unrecognized token");
}

⌨️ 快捷键说明

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