📄 cimmof_tab.cpp
字号:
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; /* 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: /* 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 5:#line 319 "cimmof.y" { /* FIXME: Where do we put directives? */ ;} break; case 6:#line 321 "cimmof.y" { cimmofParser::Instance()->addQualifier(yyvsp[0].mofqualifier); delete yyvsp[0].mofqualifier; ;} break; case 7:#line 323 "cimmof.y" { cimmofParser::Instance()->addClass(yyvsp[0].mofclass); ;} break; case 8:#line 325 "cimmof.y" { cimmofParser::Instance()->addInstance(yyvsp[0].instance); ;} break; case 9:#line 338 "cimmof.y" { YACCTRACE("classDeclaration"); if (g_currentAliasDecl != String::EMPTY) cimmofParser::Instance()->addClassAlias(g_currentAliasDecl, yyval.mofclass, false);;} break; case 10:#line 346 "cimmof.y" { // create new instance of class with className and superclassName // put returned class object on stack YACCTRACE("classHead:"); yyval.mofclass = cimmofParser::Instance()->newClassDecl(*yyvsp[-2].cimnameval, *yyvsp[0].cimnameval); // put list of qualifiers into class applyQualifierList(&g_qualifierList, yyval.mofclass); g_currentAliasRef = *yyvsp[-1].strval; if (g_currentClass) delete g_currentClass; g_currentClass = yyval.mofclass; delete yyvsp[-2].cimnameval; delete yyvsp[-1].strval; delete yyvsp[0].cimnameval;;} break; case 11:#line 365 "cimmof.y" {;} break; case 12:#line 368 "cimmof.y" { yyval.cimnameval = new CIMName(*yyvsp[0].cimnameval); ;} break; case 13:#line 369 "cimmof.y" { yyval.cimnameval = new CIMName(); ;} break; case 18:#line 380 "cimmof.y" { YACCTRACE("classFeature:applyProperty"); cimmofParser::Instance()->applyProperty(*g_currentClass, *yyvsp[0].property); delete yyvsp[0].property; ;} break; case 19:#line 383 "cimmof.y" { YACCTRACE("classFeature:applyMethod"); cimmofParser::Instance()->applyMethod(*g_currentClass, *yyvsp[0].method); ;} break; case 20:#line 386 "cimmof.y" { YACCTRACE("classFeature:applyProperty"); cimmofParser::Instance()->applyProperty(*g_currentClass, *yyvsp[0].property); delete yyvsp[0].property; ;} break; case 21:#line 404 "cimmof.y" { YACCTRACE("methodDeclaration"); yyval.method = yyvsp[-2].method;;} break; case 22:#line 415 "cimmof.y" { YACCTRACE("methodHead"); if (g_currentMethod) delete g_currentMethod; // create new method instance with pointer to method name and datatype g_currentMethod = cimmofParser::Instance()->newMethod(*yyvsp[0].cimnameval, yyvsp[-1].datatype) ; // put new method on stack yyval.method = g_currentMethod; // apply the method qualifier list. applyQualifierList(&g_qualifierList, yyval.method); delete yyvsp[0].cimnameval;;} break; case 25:#line 439 "cimmof.y" { yyval.cimnameval = new CIMName(*yyvsp[0].strval); ;} break; case 29:#line 451 "cimmof.y" { // ATTN: P2 2002 Question Need to create default value including type? YACCTRACE("parameter:"); CIMParameter *p = 0; cimmofParser *cp = cimmofParser::Instance(); // Create new parameter with name, type, isArray, array, referenceClassName if (yyvsp[0].ival == -1) { p = cp->newParameter(*yyvsp[-1].cimnameval, yyvsp[-2].datatype, false, 0, g_referenceClassName); } else { p = cp->newParameter(*yyvsp[-1].cimnameval, yyvsp[-2].datatype, true, yyvsp[0].ival, g_referenceClassName); } g_referenceClassName = CIMName(); YACCTRACE("parameter:applyQualifierList"); applyQualifierList(&g_qualifierList, p); cp->applyParameter(*g_currentMethod, *p); delete p; delete yyvsp[-1].cimnameval;;} break; case 30:#line 476 "cimmof.y" { yyval.datatype = yyvsp[0].datatype; ;} break; case 31:#line 477 "cimmof.y" { yyval.datatype = CIMTYPE_REFERENCE; ;} break; case 32:#line 493 "cimmof.y" { // set body to stack and apply qualifier list // ATTN: the apply qualifer only works here because // there are not lower level qualifiers. We do productions // that might have lower level qualifiers differently by // setting up a xxxHead production where qualifiers are // applied. YACCTRACE("propertyDeclaration:"); yyval.property = yyvsp[-1].property; applyQualifierList(&g_qualifierList, yyval.property);;} break; case 33:#line 507 "cimmof.y" { CIMValue *v = valueFactory::createValue(yyvsp[-3].datatype, yyvsp[-1].ival, (yyvsp[0].typedinitializer->type == CIMMOF_NULL_VALUE), yyvsp[0].typedinitializer->value); if (yyvsp[-1].ival == -1) { yyval.property = cimmofParser::Instance()->newProperty(*yyvsp[-2].cimnameval, *v, false, 0);} else { yyval.property = cimmofParser::Instance()->newProperty(*yyvsp[-2].cimnameval, *v, true, yyvsp[-1].ival); } delete yyvsp[-2].cimnameval; delete yyvsp[0].typedinitializer->value; delete v;;} break; case 35:#line 539 "cimmof.y" { String s(*yyvsp[-4].strval); if (!String::equal(*yyvsp[-1].strval, String::EMPTY)) s.append("." + *yyvsp[-1].strval); CIMValue *v = valueFactory::createValue(CIMTYPE_REFERENCE, -1, true, &s); //KS add the isArray and arraysize parameters. 8 mar 2002 yyval.property = cimmofParser::Instance()->newProperty(*yyvsp[-2].strval, *v, false,0, *yyvsp[-4].strval); applyQualifierList(&g_qualifierList, yyval.property); delete yyvsp[-4].strval; delete yyvsp[-2].strval; delete yyvsp[-1].strval; delete v;;} break; case 36:#line 554 "cimmof.y" { yyval.strval = yyvsp[0].strval; ;} break; case 37:#line 557 "cimmof.y" { yyval.strval = yyvsp[0].strval; ;} break; case 38:#line 560 "cimmof.y" { yyval.strval = yyvsp[0].strval; ;} break; case 39:#line 561 "cimmof.y" { yyval.strval = new String(String::EMPTY); ;} break; case 40:#line 564 "cimmof.y" { g_referenceClassName = *yyvsp[-1].cimnameval; ;} break; case 41:#line 568 "cimmof.y" { yyval.cimnameval = new CIMName(*yyvsp[0].strval); ;} break; case 42:#line 571 "cimmof.y" { yyval.cimnameval = new CIMName(*yyvsp[0].strval); ;} break; case 43:#line 576 "cimmof.y" { yyval.ival = valueFactory::Stoi(*yyvsp[-1].strval); delete yyvsp[-1].strval; ;} break; case 44:#line 579 "cimmof.y" { yyval.ival = 0; ;} break; case 45:#line 580 "cimmof.y" { yyval.ival = -1; ;} break; case 46:#line 583 "cimmof.y" { yyval.typedinitializer = yyvsp[0].typedinitializer; ;} break; case 47:#line 584 "cimmof.y" { /* empty */ g_typedInitializerValue.type = CIMMOF_NULL_VALUE; g_typedInitializerValue.value = new String(String::EMPTY); yyval.typedinitializer = &g_typedInitializerValue; ;} break; case 48:#line 591 "cimmof.y" { yyval.strval = yyvsp[0].strval; ;} break; case 49:#line 592 "cimmof.y" { yyval.strval = yyvsp[0].strval; ;} break; case 50:#line 593 "cimmof.y" { yyval.strval = yyvsp[0].strval; ;} break; case 51:#line 600 "cimmof.y" { g_typedInitializerValue.type = CIMMOF_CONSTANT_VALUE; g_typedInitializerValue.value = yyvsp[0].strval; yyval.typedinitializer = &g_typedInitializerValue; ;} break; case 52:#line 606 "cimmof.y" { g_typedInitializerValue.type = CIMMOF_NULL_VALUE; g_typedInitializerValue.value = new String(String::EMPTY); yyval.typedinitializer = &g_typedInitializerValue; ;} break; case 53:#line 612 "cimmof.y" { g_typedInitializerValue.type = CIMMOF_ARRAY_VALUE; g_typedInitializerValue.value = yyvsp[0].strval;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -