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

📄 wqlyacc.cpp

📁 Pegasus is an open-source implementationof the DMTF CIM and WBEM standards. It is designed to be por
💻 CPP
📖 第 1 页 / 共 3 页
字号:
| 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:  /* yyn is the number of a rule to reduce with.  */  yylen = yyr2[yyn];  /* If YYLEN is nonzero, implement the default value of the action:     `$$ = $1'.     Otherwise, the following line sets YYVAL to garbage.     This behavior is undocumented and Bison     users should not rely upon it.  Assigning to YYVAL     unconditionally makes the parser a bit smaller, and it avoids a     GCC warning that YYVAL may be used uninitialized.  */  yyval = yyvsp[1-yylen];  YY_REDUCE_PRINT (yyn);  switch (yyn)    {        case 2:#line 161 "WQL.y"    {	WQL_TRACE(("YACC: start\n"));    ;}    break;  case 3:#line 167 "WQL.y"    {    ;}    break;  case 4:#line 173 "WQL.y"    {	globalParserState->statement->setAllProperties(true);    ;}    break;  case 5:#line 177 "WQL.y"    {    ;}    break;  case 6:#line 183 "WQL.y"    {	globalParserState->statement->appendSelectPropertyName(CIMName(yyvsp[0].strValue));    ;}    break;  case 7:#line 187 "WQL.y"    {	globalParserState->statement->appendSelectPropertyName(CIMName(yyvsp[0].strValue));    ;}    break;  case 8:#line 193 "WQL.y"    {    ;}    break;  case 9:#line 197 "WQL.y"    {    ;}    break;  case 10:#line 203 "WQL.y"    {	WQL_TRACE(("YACC: fromClause: TOK_FROM className(%s)\n", yyvsp[0].strValue));	globalParserState->statement->setClassName(CIMName(yyvsp[0].strValue));    ;}    break;  case 11:#line 210 "WQL.y"    {    ;}    break;  case 12:#line 216 "WQL.y"    {	WQL_TRACE(("YACC: TOK_OR\n"));	globalParserState->statement->appendOperation(WQL_OR);    ;}    break;  case 13:#line 221 "WQL.y"    {	WQL_TRACE(("YACC: TOK_AND\n"));	globalParserState->statement->appendOperation(WQL_AND);    ;}    break;  case 14:#line 226 "WQL.y"    {	WQL_TRACE(("YACC: TOK_NOT\n"));	globalParserState->statement->appendOperation(WQL_NOT);    ;}    break;  case 15:#line 232 "WQL.y"    {    ;}    break;  case 16:#line 236 "WQL.y"    {    ;}    break;  case 17:#line 240 "WQL.y"    {	WQLOperation op = yyvsp[0].intValue ? WQL_IS_TRUE : WQL_IS_FALSE;	globalParserState->statement->appendOperation(op);    ;}    break;  case 18:#line 245 "WQL.y"    {	WQLOperation op = yyvsp[0].intValue ? WQL_IS_NOT_TRUE : WQL_IS_NOT_FALSE;	globalParserState->statement->appendOperation(op);    ;}    break;  case 19:#line 254 "WQL.y"    {    ;}    break;  case 20:#line 258 "WQL.y"    {    ;}    break;  case 21:#line 264 "WQL.y"    {	WQL_TRACE(("YACC: TOK_LT\n"));	globalParserState->statement->appendOperation(WQL_LT);    ;}    break;  case 22:#line 269 "WQL.y"    {	WQL_TRACE(("YACC: TOK_GT\n"));	globalParserState->statement->appendOperation(WQL_GT);    ;}    break;  case 23:#line 274 "WQL.y"    {	WQL_TRACE(("YACC: TOK_LE\n"));	globalParserState->statement->appendOperation(WQL_LE);    ;}    break;  case 24:#line 279 "WQL.y"    {	WQL_TRACE(("YACC: TOK_GE\n"));	globalParserState->statement->appendOperation(WQL_GE);    ;}    break;  case 25:#line 284 "WQL.y"    {	WQL_TRACE(("YACC: TOK_EQ\n"));	globalParserState->statement->appendOperation(WQL_EQ);    ;}    break;  case 26:#line 289 "WQL.y"    {	WQL_TRACE(("YACC: TOK_NE\n"));	globalParserState->statement->appendOperation(WQL_NE);    ;}    break;  case 27:#line 294 "WQL.y"    {    WQL_TRACE(("YACC: TOK_ISA\n"));#ifndef PEGASUS_SNIA_EXTENSIONS        // If SNIA tests, allow the ISA but do not pass className        yyerror("ISA Token Not Supported");#endif    ;}    break;  case 28:#line 304 "WQL.y"    {	WQL_TRACE(("YACC: nullPredicate : comparisonTerm IS NULL\n"));	globalParserState->statement->appendOperation(WQL_IS_NULL);    ;}    break;  case 29:#line 309 "WQL.y"    {	WQL_TRACE(("YACC: nullPredicate : comparisonTerm IS NOT NULL\n"));	globalParserState->statement->appendOperation(WQL_IS_NOT_NULL);    ;}    break;  case 30:#line 316 "WQL.y"    {	yyval.intValue = 1;    ;}    break;  case 31:#line 320 "WQL.y"    {	yyval.intValue = 0;    ;}    break;  case 32:#line 333 "WQL.y"    {        WQL_TRACE(("YACC: propertyName : TOK_IDENTIFIER(%s)\n", yyvsp[0].strValue));        yyval.strValue = yyvsp[0].strValue;    ;}    break;  case 33:#line 338 "WQL.y"    {        WQL_TRACE(("YACC: propertyName : TOK_IDENTIFIER(%s.%s)\n", yyvsp[-2].strValue, yyvsp[0].strValue));#ifdef PEGASUS_SNIA_EXTENSIONS        // Pass anything as a property name to fool parser for SNIA testing        yyval.strValue = strdup("dummy");#else        yyerror("Scoped (dotted) property names not supported");#endif    ;}    break;  case 34:#line 350 "WQL.y"    {	WQL_TRACE(("YACC: TOK_IDENTIFIER %s\n", yyvsp[0].strValue));	yyval.strValue = yyvsp[0].strValue;    ;}    break;  case 35:#line 357 "WQL.y"    {	globalParserState->statement->appendOperand(	    WQLOperand(yyvsp[0].strValue, WQL_PROPERTY_NAME_TAG));	globalParserState->statement->appendWherePropertyName(CIMName(yyvsp[0].strValue));    ;}    break;  case 36:#line 363 "WQL.y"    {	globalParserState->statement->appendOperand(	    WQLOperand(yyvsp[0].intValue, WQL_INTEGER_VALUE_TAG));    ;}    break;  case 37:#line 368 "WQL.y"    {	globalParserState->statement->appendOperand(	    WQLOperand(yyvsp[0].doubleValue, WQL_DOUBLE_VALUE_TAG));    ;}    break;  case 38:#line 373 "WQL.y"    {	globalParserState->statement->appendOperand(	    WQLOperand(yyvsp[0].strValue, WQL_STRING_VALUE_TAG));    ;}    break;  case 39:#line 378 "WQL.y"    {	globalParserState->statement->appendOperand(	    WQLOperand(yyvsp[0].intValue != 0, WQL_BOOLEAN_VALUE_TAG));    ;}    break;    }/* Line 1000 of yacc.c.  */#line 1429 "WQLtemp"  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 lookahead 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;		 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);		 yydestruct (yystos[*yyssp], yyvsp);	       }        }      else	{	  YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);	  yydestruct (yytoken, &yylval);	  yychar = YYEMPTY;	}    }  /* Else will try to reuse lookahead 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;#endif  yyvsp -= 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;      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);      yydestruct (yystos[yystate], yyvsp);      YYPOPSTACK;      yystate = *yyssp;      YY_STACK_PRINT (yyss, yyssp);    }  if (yyn == YYFINAL)    YYACCEPT;  YYDPRINTF ((stderr, "Shifting error token, "));  *++yyvsp = yylval;  yystate = yyn;  goto yynewstate;/*-------------------------------------.| yyacceptlab -- YYACCEPT comes here.  |`-------------------------------------*/yyacceptlab:  yyresult = 0;  goto yyreturn;/*-----------------------------------.| yyabortlab -- YYABORT comes here.  |`-----------------------------------*/yyabortlab:  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;}#line 383 "WQL.y"

⌨️ 快捷键说明

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