int Map_Team::lineup_clear(Scene_Player &player) { Int_Role_Id int_role_id; int_role_id.role_id = 0; int_role_id.int_value = 0; Int_Role_Id_Vec lineup(this->lineup_); if (this->is_role_in_lineup(player.role_id())) { // impossile this->lineup_.clear(); for (Int_Role_Id_Vec::iterator it = lineup.begin(); it != lineup.end(); ++it) { if (it->role_id == player.role_id()) { this->lineup_.push_back(int_role_id); } else { this->lineup_.push_back(*it); } } } this->lineup_active(); return 0; }
void SliderTestCase::LineUpDown() { #if wxUSE_UIACTIONSIMULATOR EventCounter lineup(m_slider, wxEVT_SCROLL_LINEUP); EventCounter linedown(m_slider, wxEVT_SCROLL_LINEDOWN); wxUIActionSimulator sim; wxYield(); m_slider->SetFocus(); sim.Char(WXK_UP); sim.Char(WXK_DOWN); wxYield(); CPPUNIT_ASSERT_EQUAL(1, lineup.GetCount()); CPPUNIT_ASSERT_EQUAL(1, linedown.GetCount()); #endif }
int yyparse(void) { struct { YYSTYPE yyv; int yys; } yys[YYMAXDEPTH], *yyp, *yypt; short *yyxi; int yyj, yym, yystate, yyn, yyg; YYSTYPE save1, save2; int save3, save4; long yychar; save1 = yylval; save2 = yyval; save3 = yynerrs; save4 = yyerrflag; yystate = 0; yychar = -1; yynerrs = 0; yyerrflag = 0; yyp = &yys[-1]; goto yystack; ret0: yyn = 0; goto ret; ret1: yyn = 1; goto ret; ret: yylval = save1; yyval = save2; yynerrs = save3; yyerrflag = save4; return yyn; yystack: /* put a state and value onto the stack */ if(yydebug >= 4) printf("char %s in %s", yytokname(yychar), yystatname(yystate)); yyp++; if(yyp >= &yys[YYMAXDEPTH]) { yyerror("yacc stack overflow"); goto ret1; } yyp->yys = yystate; yyp->yyv = yyval; yynewstate: yyn = yypact[yystate]; if(yyn <= YYFLAG) goto yydefault; /* simple state */ if(yychar < 0) yychar = yylex1(); yyn += yychar; if(yyn < 0 || yyn >= YYLAST) goto yydefault; yyn = yyact[yyn]; if(yychk[yyn] == yychar) { /* valid shift */ yychar = -1; yyval = yylval; yystate = yyn; if(yyerrflag > 0) yyerrflag--; goto yystack; } yydefault: /* default state action */ yyn = yydef[yystate]; if(yyn == -2) { if(yychar < 0) yychar = yylex1(); /* look through exception table */ for(yyxi=yyexca;; yyxi+=2) if(yyxi[0] == -1 && yyxi[1] == yystate) break; for(yyxi += 2;; yyxi += 2) { yyn = yyxi[0]; if(yyn < 0 || yyn == yychar) break; } yyn = yyxi[1]; if(yyn < 0) goto ret0; } if(yyn == 0) { /* error ... attempt to resume parsing */ switch(yyerrflag) { case 0: /* brand new error */ yyerror("syntax error"); if(yydebug >= 1) { printf("%s", yystatname(yystate)); printf("saw %s\n", yytokname(yychar)); } yyerrlab: yynerrs++; case 1: case 2: /* incompletely recovered error ... try again */ yyerrflag = 3; /* find a state where "error" is a legal shift action */ while(yyp >= yys) { yyn = yypact[yyp->yys] + YYERRCODE; if(yyn >= 0 && yyn < YYLAST) { yystate = yyact[yyn]; /* simulate a shift of "error" */ if(yychk[yystate] == YYERRCODE) goto yystack; } /* the current yyp has no shift onn "error", pop stack */ if(yydebug >= 2) printf("error recovery pops state %d, uncovers %d\n", yyp->yys, (yyp-1)->yys ); yyp--; } /* there is no state on the stack with an error shift ... abort */ goto ret1; case 3: /* no shift yet; clobber input char */ if(yydebug >= YYEOFCODE) printf("error recovery discards %s\n", yytokname(yychar)); if(yychar == YYEOFCODE) goto ret1; yychar = -1; goto yynewstate; /* try again in the same state */ } } /* reduction by production yyn */ if(yydebug >= 2) printf("reduce %d in:\n\t%s", yyn, yystatname(yystate)); yypt = yyp; yyp -= yyr2[yyn]; yyval = (yyp+1)->yyv; yym = yyn; /* consult goto table to find next state */ yyn = yyr1[yyn]; yyg = yypgo[yyn]; yyj = yyg + yyp->yys + 1; if(yyj >= YYLAST || yychk[yystate=yyact[yyj]] != -yyn) yystate = yyact[yyg]; switch(yym) { case 1: #line 24 "/sys/src/cmd/eqn/eqn.y" { putout(yypt[-0].yyv); } break; case 2: #line 25 "/sys/src/cmd/eqn/eqn.y" { ERROR "syntax error" WARNING; } break; case 3: #line 26 "/sys/src/cmd/eqn/eqn.y" { eqnreg = 0; } break; case 5: #line 30 "/sys/src/cmd/eqn/eqn.y" { eqnbox(yypt[-1].yyv, yypt[-0].yyv, 0); } break; case 6: #line 31 "/sys/src/cmd/eqn/eqn.y" { eqnbox(yypt[-1].yyv, yypt[-0].yyv, 1); } break; case 7: #line 32 "/sys/src/cmd/eqn/eqn.y" { lineup(0); } break; case 8: #line 35 "/sys/src/cmd/eqn/eqn.y" { yyval = yypt[-0].yyv; lineup(1); } break; case 9: #line 38 "/sys/src/cmd/eqn/eqn.y" { yyval = yypt[-0].yyv; } break; case 10: #line 39 "/sys/src/cmd/eqn/eqn.y" { yyval = 0; } break; case 11: #line 42 "/sys/src/cmd/eqn/eqn.y" { yyval = yypt[-0].yyv; } break; case 12: #line 43 "/sys/src/cmd/eqn/eqn.y" { yyval = 0; } break; case 13: #line 46 "/sys/src/cmd/eqn/eqn.y" { yyval = yypt[-1].yyv; } break; case 14: #line 47 "/sys/src/cmd/eqn/eqn.y" { text(QTEXT, (char *) yypt[-0].yyv); } break; case 15: #line 48 "/sys/src/cmd/eqn/eqn.y" { text(CONTIG, (char *) yypt[-0].yyv); } break; case 16: #line 49 "/sys/src/cmd/eqn/eqn.y" { text(SPACE, (char *) 0); } break; case 17: #line 50 "/sys/src/cmd/eqn/eqn.y" { text(THIN, (char *) 0); } break; case 18: #line 51 "/sys/src/cmd/eqn/eqn.y" { text(TAB, (char *) 0); } break; case 19: #line 52 "/sys/src/cmd/eqn/eqn.y" { funny(SUM); } break; case 20: #line 53 "/sys/src/cmd/eqn/eqn.y" { funny(PROD); } break; case 21: #line 54 "/sys/src/cmd/eqn/eqn.y" { funny(UNION); } break; case 22: #line 55 "/sys/src/cmd/eqn/eqn.y" { funny(INTER); } break; case 23: #line 56 "/sys/src/cmd/eqn/eqn.y" { boverb(yypt[-2].yyv, yypt[-0].yyv); } break; case 24: #line 57 "/sys/src/cmd/eqn/eqn.y" { mark(yypt[-0].yyv); } break; case 25: #line 58 "/sys/src/cmd/eqn/eqn.y" { size(yypt[-1].yyv, yypt[-0].yyv); } break; case 26: #line 59 "/sys/src/cmd/eqn/eqn.y" { font(yypt[-1].yyv, yypt[-0].yyv); } break; case 27: #line 60 "/sys/src/cmd/eqn/eqn.y" { fatbox(yypt[-0].yyv); } break; case 28: #line 61 "/sys/src/cmd/eqn/eqn.y" { sqrt(yypt[-0].yyv); } break; case 29: #line 62 "/sys/src/cmd/eqn/eqn.y" {ps -= deltaps;} break; case 30: #line 62 "/sys/src/cmd/eqn/eqn.y" { subsup(yypt[-4].yyv, yypt[-1].yyv, yypt[-0].yyv); } break; case 31: #line 63 "/sys/src/cmd/eqn/eqn.y" {ps -= deltaps;} break; case 32: #line 63 "/sys/src/cmd/eqn/eqn.y" { subsup(yypt[-3].yyv, 0, yypt[-0].yyv); } break; case 33: #line 64 "/sys/src/cmd/eqn/eqn.y" {ps -= deltaps;} break; case 34: #line 64 "/sys/src/cmd/eqn/eqn.y" { integral(yypt[-4].yyv, yypt[-1].yyv, yypt[-0].yyv); } break; case 35: #line 65 "/sys/src/cmd/eqn/eqn.y" {ps -= deltaps;} break; case 36: #line 65 "/sys/src/cmd/eqn/eqn.y" { integral(yypt[-3].yyv, 0, yypt[-0].yyv); } break; case 37: #line 66 "/sys/src/cmd/eqn/eqn.y" { integral(yypt[-0].yyv, 0, 0); } break; case 38: #line 67 "/sys/src/cmd/eqn/eqn.y" {ps -= deltaps;} break; case 39: #line 67 "/sys/src/cmd/eqn/eqn.y" { fromto(yypt[-4].yyv, yypt[-1].yyv, yypt[-0].yyv); } break; case 40: #line 68 "/sys/src/cmd/eqn/eqn.y" {ps -= deltaps;} break; case 41: #line 68 "/sys/src/cmd/eqn/eqn.y" { fromto(yypt[-3].yyv, 0, yypt[-0].yyv); } break; case 42: #line 69 "/sys/src/cmd/eqn/eqn.y" { paren(yypt[-2].yyv, yypt[-1].yyv, yypt[-0].yyv); } break; case 43: #line 70 "/sys/src/cmd/eqn/eqn.y" { paren(yypt[-1].yyv, yypt[-0].yyv, 0); } break; case 44: #line 71 "/sys/src/cmd/eqn/eqn.y" { diacrit(yypt[-1].yyv, yypt[-0].yyv); } break; case 45: #line 72 "/sys/src/cmd/eqn/eqn.y" { move(FWD, yypt[-1].yyv, yypt[-0].yyv); } break; case 46: #line 73 "/sys/src/cmd/eqn/eqn.y" { move(UP, yypt[-1].yyv, yypt[-0].yyv); } break; case 47: #line 74 "/sys/src/cmd/eqn/eqn.y" { move(BACK, yypt[-1].yyv, yypt[-0].yyv); } break; case 48: #line 75 "/sys/src/cmd/eqn/eqn.y" { move(DOWN, yypt[-1].yyv, yypt[-0].yyv); } break; case 49: #line 76 "/sys/src/cmd/eqn/eqn.y" { pile(yypt[-0].yyv); ct = yypt[-0].yyv; } break; case 50: #line 77 "/sys/src/cmd/eqn/eqn.y" {yyval=ct;} break; case 51: #line 77 "/sys/src/cmd/eqn/eqn.y" { matrix(yypt[-3].yyv); ct = yypt[-3].yyv; } break; case 52: #line 80 "/sys/src/cmd/eqn/eqn.y" { setintegral(); } break; case 53: #line 83 "/sys/src/cmd/eqn/eqn.y" { yyval = atoi((char *) yypt[-1].yyv); } break; case 54: #line 84 "/sys/src/cmd/eqn/eqn.y" { yyval = atoi((char *) yypt[-1].yyv); } break; case 55: #line 85 "/sys/src/cmd/eqn/eqn.y" { yyval = atoi((char *) yypt[-1].yyv); } break; case 56: #line 86 "/sys/src/cmd/eqn/eqn.y" { yyval = atoi((char *) yypt[-1].yyv); } break; case 57: #line 88 "/sys/src/cmd/eqn/eqn.y" { yyval = HAT; } break; case 58: #line 89 "/sys/src/cmd/eqn/eqn.y" { yyval = VEC; } break; case 59: #line 90 "/sys/src/cmd/eqn/eqn.y" { yyval = DYAD; } break; case 60: #line 91 "/sys/src/cmd/eqn/eqn.y" { yyval = BAR; } break; case 61: #line 92 "/sys/src/cmd/eqn/eqn.y" { yyval = LOWBAR; } break; case 62: #line 93 "/sys/src/cmd/eqn/eqn.y" { yyval = HIGHBAR; } break; case 63: #line 94 "/sys/src/cmd/eqn/eqn.y" { yyval = UNDER; } break; case 64: #line 95 "/sys/src/cmd/eqn/eqn.y" { yyval = DOT; } break; case 65: #line 96 "/sys/src/cmd/eqn/eqn.y" { yyval = TILDE; } break; case 66: #line 97 "/sys/src/cmd/eqn/eqn.y" { yyval = UTILDE; } break; case 67: #line 98 "/sys/src/cmd/eqn/eqn.y" { yyval = DOTDOT; } break; case 68: #line 101 "/sys/src/cmd/eqn/eqn.y" { yyval = ((char *)yypt[-0].yyv)[0]; } break; case 69: #line 102 "/sys/src/cmd/eqn/eqn.y" { yyval = '{'; } break; case 70: #line 105 "/sys/src/cmd/eqn/eqn.y" { yyval = ((char *)yypt[-0].yyv)[0]; } break; case 71: #line 106 "/sys/src/cmd/eqn/eqn.y" { yyval = '}'; } break; case 74: #line 113 "/sys/src/cmd/eqn/eqn.y" { column(yypt[-3].yyv, DEFGAP); } break; case 75: #line 114 "/sys/src/cmd/eqn/eqn.y" {yyval=atoi((char*)yypt[-0].yyv);} break; case 76: #line 114 "/sys/src/cmd/eqn/eqn.y" { column(yypt[-5].yyv, yypt[-3].yyv); } break; case 77: #line 117 "/sys/src/cmd/eqn/eqn.y" { yyval = startcol(LCOL); } break; case 78: #line 118 "/sys/src/cmd/eqn/eqn.y" { yyval = startcol(CCOL); } break; case 79: #line 119 "/sys/src/cmd/eqn/eqn.y" { yyval = startcol(RCOL); } break; case 80: #line 120 "/sys/src/cmd/eqn/eqn.y" { yyval = startcol(COL); } break; case 81: #line 123 "/sys/src/cmd/eqn/eqn.y" { lp[ct++] = yypt[-0].yyv; } break; case 82: #line 124 "/sys/src/cmd/eqn/eqn.y" { lp[ct++] = yypt[-0].yyv; } break; case 83: #line 127 "/sys/src/cmd/eqn/eqn.y" { yyval = ps; setsize((char *) yypt[-0].yyv); } break; case 84: #line 130 "/sys/src/cmd/eqn/eqn.y" { static char R[]="R"; setfont(R); } break; case 85: #line 131 "/sys/src/cmd/eqn/eqn.y" { static char I[]="I"; setfont(I); } break; case 86: #line 132 "/sys/src/cmd/eqn/eqn.y" { static char B[]="B"; setfont(B); } break; case 87: #line 133 "/sys/src/cmd/eqn/eqn.y" { setfont((char *)yypt[-0].yyv); } break; } goto yystack; /* stack new state and value */ }