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

📄 cc_command.tab.cpp

📁 这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用于网络游戏医学图像网关的高qos要求.更详细的内容可阅读相应的材料
💻 CPP
📖 第 1 页 / 共 3 页
字号:
  ace_cc_yyn = ace_cc_yydefact[ace_cc_yystate];
  if (ace_cc_yyn == 0)
    goto ace_cc_yyerrlab;

/* Do a reduction.  ace_cc_yyn is the number of a rule to reduce with.  */
ace_cc_yyreduce:
  ace_cc_yylen = ace_cc_yyr2[ace_cc_yyn];
  if (ace_cc_yylen > 0)
    ace_cc_yyval = ace_cc_yyvsp[1-ace_cc_yylen]; /* implement default value of the action */

#if ACE_CC_YYDEBUG != 0
  if (ace_cc_yydebug)
    {
      int i;

      fprintf (stderr, "Reducing via rule %d (line %d), ",
	       ace_cc_yyn, ace_cc_yyrline[ace_cc_yyn]);

      /* Print the symbols being reduced, and their result.  */
      for (i = ace_cc_yyprhs[ace_cc_yyn]; ace_cc_yyrhs[i] > 0; i++)
	fprintf (stderr, "%s ", ace_cc_yytname[ace_cc_yyrhs[i]]);
      fprintf (stderr, " -> %s\n", ace_cc_yytname[ace_cc_yyr1[ace_cc_yyn]]);
    }
#endif


  switch (ace_cc_yyn) {

case 2:
{ cmdlist->add(new CC_Sleep_Cmd(0));
			   /* dummy to check exeption in the last command */
		  if(cmdlist->execute()!=0) //CC_FAIL
                    { printf(" ** Test succeded!!\n"); }
                  else
                    { printf(" ** Test FAILED!!\n"); } ;
    break;}
case 3:
{ cmdlist->add(ace_cc_yyvsp[0].command); ;
    break;}
case 4:
{ cmdlist->add(ace_cc_yyvsp[0].command); ;
    break;}
case 5:
{ ace_cc_yyval.command = new CC_Start_Cmd(ace_cc_yyvsp[-1].id); ;
    break;}
case 6:
{ ace_cc_yyval.command = new CC_CreateLockSet_Cmd(ace_cc_yyvsp[-1].id); ;
    break;}
case 7:
{ ace_cc_yyval.command = new CC_CreateLockSet_Cmd(""); ;
    break;}
case 8:
{ ace_cc_yyval.command = new CC_Lock_Cmd(ace_cc_yyvsp[-2].id, ace_cc_yyvsp[-1].lock_mode); ;
    break;}
case 9:
{ ace_cc_yyval.command = new CC_Lock_Cmd("", ace_cc_yyvsp[-1].lock_mode); ;
    break;}
case 10:
{ ace_cc_yyval.command = new CC_UnLock_Cmd(ace_cc_yyvsp[-2].id, ace_cc_yyvsp[-1].lock_mode); ;
    break;}
case 11:
{ ace_cc_yyval.command = new CC_UnLock_Cmd("", ace_cc_yyvsp[-1].lock_mode); ;
    break;}
case 12:
{ ace_cc_yyval.command = new CC_TryLock_Cmd(ace_cc_yyvsp[-2].id, ace_cc_yyvsp[-1].lock_mode); ;
    break;}
case 13:
{ ace_cc_yyval.command = new CC_TryLock_Cmd("", ace_cc_yyvsp[-1].lock_mode); ;
    break;}
case 14:
{ ace_cc_yyval.command = new CC_ChangeMode_Cmd(ace_cc_yyvsp[-3].id, ace_cc_yyvsp[-2].lock_mode, ace_cc_yyvsp[-1].lock_mode); ;
    break;}
case 15:
{ ace_cc_yyval.command = new CC_ChangeMode_Cmd("", ace_cc_yyvsp[-2].lock_mode, ace_cc_yyvsp[-1].lock_mode); ;
    break;}
case 16:
{ ace_cc_yyval.command = new CC_Sleep_Cmd(ace_cc_yyvsp[-1].num); ;
    break;}
case 17:
{ ace_cc_yyval.command = new CC_Wait_Cmd(""); ;
    break;}
case 18:
{ ace_cc_yyval.command = new CC_Wait_Cmd(ace_cc_yyvsp[-1].id); ;
    break;}
case 19:
{ ace_cc_yyval.command = new CC_Print_Cmd(ace_cc_yyvsp[-1].id); ;
    break;}
case 20:
{ ace_cc_yyval.command = new CC_Lookup_Cmd(ace_cc_yyvsp[-1].id); ;
    break;}
case 21:
{ cmdlist->setrepeat(ace_cc_yyvsp[-1].num);
                          ace_cc_yyval.command = new CC_Dummy_Cmd();;
    break;}
case 22:
{ ace_cc_yyval.command = new CC_Excep_Cmd(ace_cc_yyvsp[-1].id); ;
    break;}
case 23:
{ace_cc_yyval.id = ace_cc_yyvsp[0].id; ;
    break;}
case 24:
{ace_cc_yyval.id = ace_cc_yyvsp[0].id; ;
    break;}
case 25:
{ace_cc_yyval.id = ace_cc_yyvsp[0].id; ;
    break;}
case 26:
{ ace_cc_yyval.lock_mode = CosConcurrencyControl::read; ;
    break;}
case 27:
{ ace_cc_yyval.lock_mode = CosConcurrencyControl::intention_read; ;
    break;}
case 28:
{ ace_cc_yyval.lock_mode = CosConcurrencyControl::upgrade; ;
    break;}
case 29:
{ ace_cc_yyval.lock_mode = CosConcurrencyControl::write; ;
    break;}
case 30:
{ ace_cc_yyval.lock_mode = CosConcurrencyControl::intention_write; ;
    break;}
}
   /* the action file gets copied in in place of this dollarsign */


  ace_cc_yyvsp -= ace_cc_yylen;
  ace_cc_yyssp -= ace_cc_yylen;
#ifdef ACE_CC_YYLSP_NEEDED
  ace_cc_yylsp -= ace_cc_yylen;
#endif

#if ACE_CC_YYDEBUG != 0
  if (ace_cc_yydebug)
    {
      short *ssp1 = ace_cc_yyss - 1;
      fprintf (stderr, "state stack now");
      while (ssp1 != ace_cc_yyssp)
	fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

  *++ace_cc_yyvsp = ace_cc_yyval;

#ifdef ACE_CC_YYLSP_NEEDED
  ace_cc_yylsp++;
  if (ace_cc_yylen == 0)
    {
      ace_cc_yylsp->first_line = ace_cc_yylloc.first_line;
      ace_cc_yylsp->first_column = ace_cc_yylloc.first_column;
      ace_cc_yylsp->last_line = (ace_cc_yylsp-1)->last_line;
      ace_cc_yylsp->last_column = (ace_cc_yylsp-1)->last_column;
      ace_cc_yylsp->text = 0;
    }
  else
    {
      ace_cc_yylsp->last_line = (ace_cc_yylsp+ace_cc_yylen-1)->last_line;
      ace_cc_yylsp->last_column = (ace_cc_yylsp+ace_cc_yylen-1)->last_column;
    }
#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.  */

  ace_cc_yyn = ace_cc_yyr1[ace_cc_yyn];

  ace_cc_yystate = ace_cc_yypgoto[ace_cc_yyn - ACE_CC_YYNTBASE] + *ace_cc_yyssp;
  if (ace_cc_yystate >= 0 && ace_cc_yystate <= ACE_CC_YYLAST && ace_cc_yycheck[ace_cc_yystate] == *ace_cc_yyssp)
    ace_cc_yystate = ace_cc_yytable[ace_cc_yystate];
  else
    ace_cc_yystate = ace_cc_yydefgoto[ace_cc_yyn - ACE_CC_YYNTBASE];

  goto ace_cc_yynewstate;

ace_cc_yyerrlab:   /* here on detecting error */

  if (! ace_cc_yyerrstatus)
    /* If not already recovering from an error, report this error.  */
    {
      ++ace_cc_yynerrs;

#ifdef ACE_CC_YYERROR_VERBOSE
      ace_cc_yyn = ace_cc_yypact[ace_cc_yystate];

      if (ace_cc_yyn > ACE_CC_YYFLAG && ace_cc_yyn < ACE_CC_YYLAST)
	{
	  int size = 0;
	  char *msg;
	  int x, count;

	  count = 0;
	  /* Start X at -ace_cc_yyn if nec to avoid negative indexes in ace_cc_yycheck.  */
	  for (x = (ace_cc_yyn < 0 ? -ace_cc_yyn : 0);
	       x < (sizeof(ace_cc_yytname) / sizeof(char *)); x++)
	    if (ace_cc_yycheck[x + ace_cc_yyn] == x)
	      size += strlen(ace_cc_yytname[x]) + 15, count++;
	  msg = (char *) malloc(size + 15);
	  if (msg != 0)
	    {
	      strcpy(msg, "parse error");

	      if (count < 5)
		{
		  count = 0;
		  for (x = (ace_cc_yyn < 0 ? -ace_cc_yyn : 0);
		       x < (sizeof(ace_cc_yytname) / sizeof(char *)); x++)
		    if (ace_cc_yycheck[x + ace_cc_yyn] == x)
		      {
			strcat(msg, count == 0 ? ", expecting `" : " or `");
			strcat(msg, ace_cc_yytname[x]);
			strcat(msg, "'");
			count++;
		      }
		}
	      ace_cc_yyerror(msg);
	      free(msg);
	    }
	  else
	    ace_cc_yyerror ("parse error; also virtual memory exceeded");
	}
      else
#endif /* ACE_CC_YYERROR_VERBOSE */
	ace_cc_yyerror("parse error");
    }

  goto ace_cc_yyerrlab1;
ace_cc_yyerrlab1:   /* here on error raised explicitly by an action */

  if (ace_cc_yyerrstatus == 3)
    {
      /* if just tried and failed to reuse lookahead token after an error, discard it.  */

      /* return failure if at end of input */
      if (ace_cc_yychar == ACE_CC_YYEOF)
	ACE_CC_YYABORT;

#if ACE_CC_YYDEBUG != 0
      if (ace_cc_yydebug)
	fprintf(stderr, "Discarding token %d (%s).\n", ace_cc_yychar, ace_cc_yytname[ace_cc_yychar1]);
#endif

      ace_cc_yychar = ACE_CC_YYEMPTY;
    }

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

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

  goto ace_cc_yyerrhandle;

ace_cc_yyerrdefault:  /* current state does not do anything special for the error token. */

#if 0
  /* This is wrong; only states that explicitly want error tokens
     should shift them.  */
  ace_cc_yyn = ace_cc_yydefact[ace_cc_yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  if (ace_cc_yyn) goto ace_cc_yydefault;
#endif

ace_cc_yyerrpop:   /* pop the current state because it cannot handle the error token */

  if (ace_cc_yyssp == ace_cc_yyss) ACE_CC_YYABORT;
  ace_cc_yyvsp--;
  ace_cc_yystate = *--ace_cc_yyssp;
#ifdef ACE_CC_YYLSP_NEEDED
  ace_cc_yylsp--;
#endif

#if ACE_CC_YYDEBUG != 0
  if (ace_cc_yydebug)
    {
      short *ssp1 = ace_cc_yyss - 1;
      fprintf (stderr, "Error: state stack now");
      while (ssp1 != ace_cc_yyssp)
	fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

ace_cc_yyerrhandle:

  ace_cc_yyn = ace_cc_yypact[ace_cc_yystate];
  if (ace_cc_yyn == ACE_CC_YYFLAG)
    goto ace_cc_yyerrdefault;

  ace_cc_yyn += ACE_CC_YYTERROR;
  if (ace_cc_yyn < 0 || ace_cc_yyn > ACE_CC_YYLAST || ace_cc_yycheck[ace_cc_yyn] != ACE_CC_YYTERROR)
    goto ace_cc_yyerrdefault;

  ace_cc_yyn = ace_cc_yytable[ace_cc_yyn];
  if (ace_cc_yyn < 0)
    {
      if (ace_cc_yyn == ACE_CC_YYFLAG)
	goto ace_cc_yyerrpop;
      ace_cc_yyn = -ace_cc_yyn;
      goto ace_cc_yyreduce;
    }
  else if (ace_cc_yyn == 0)
    goto ace_cc_yyerrpop;

  if (ace_cc_yyn == ACE_CC_YYFINAL)
    ACE_CC_YYACCEPT;

#if ACE_CC_YYDEBUG != 0
  if (ace_cc_yydebug)
    fprintf(stderr, "Shifting error token, ");
#endif

  *++ace_cc_yyvsp = ace_cc_yylval;
#ifdef ACE_CC_YYLSP_NEEDED
  *++ace_cc_yylsp = ace_cc_yylloc;
#endif

  ace_cc_yystate = ace_cc_yyn;
  goto ace_cc_yynewstate;

 ace_cc_yyacceptlab:
  /* ACE_CC_YYACCEPT comes here.  */
  if (ace_cc_yyfree_stacks)
    {
      free (ace_cc_yyss);
      free (ace_cc_yyvs);
#ifdef ACE_CC_YYLSP_NEEDED
      free (ace_cc_yyls);
#endif
    }
  return 0;

 ace_cc_yyabortlab:
  /* ACE_CC_YYABORT comes here.  */
  if (ace_cc_yyfree_stacks)
    {
      free (ace_cc_yyss);
      free (ace_cc_yyvs);
#ifdef ACE_CC_YYLSP_NEEDED
      free (ace_cc_yyls);
#endif
    }
  return 1;
}


void
ace_cc_yyerror (const char *s)
{
  ACE_OS::printf ("%d: %s at %s in:\n%s\n",
                  line_no,
                  s,
                  ace_cc_yytext,
                  line_buf);
  ACE_OS::exit (-1);
}

⌨️ 快捷键说明

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