void print_verbose_err_msg (void) { switch (Errcode) { case EBACKWARD: remark ("Line numbers in backward order"); break; case ESE_NOPAT: remark ("No saved pattern -- sorry"); break; case EBADPAT: remark ("Bad syntax in pattern"); break; case EBADSTR: remark ("Bad syntax in string parameter"); break; case EBADSUB: remark ("Bad syntax in substitution string"); break; case ECANTREAD: remark ("File is not readable"); break; case EEGARB: remark ("Garbage after your command"); break; case EFILEN: remark ("Bad syntax in file name"); break; case EBADTABS: remark ("Bad tabstop syntax"); break; case EINSIDEOUT: remark ("Can't move a group into itself"); break; case EKSE_NOTFND: remark ("No line has that mark name"); break; case ELINE1: remark (""); break; case E2LONG: remark ("Resultant line too long to handle"); break; case ESE_NOSE_ERR: remark ("No error to report"); break; case ESE_NOLIMBO: remark ("No lines in limbo"); break; case EODLSSGTR: remark ("Expected '<', '>', or nothing after 'od'"); break; case EORANGE: remark ("Line number out of range"); break; case EOWHAT: remark ("Can't recognize option"); break; case EPSE_NOTFND: remark ("No line contains that pattern"); break; case ESTUPID: remark ("Buffer hasn't been saved"); break; case EWHATZAT: remark ("No command recognized"); break; case EBREAK: remark ("You interrupted me"); break; case ELINE2: remark ("Last line number beyond end of file"); break; case ECANTWRITE: remark ("File is not writeable"); break; case ECANTINJECT: remark ("No room for any more lines!"); break; case ESE_NOMATCH: remark ("No match for pattern"); break; case ESE_NOFN: remark ("No saved filename"); break; case EBADLIST: remark ("Bad syntax in character list"); break; case ESE_NOLIST: remark ("No saved character list -- sorry"); break; case ESE_NONSENSE: remark ("Unreasonable value"); break; case ESE_NOHELP: remark ("No help available"); break; case EBADLNR: remark ("Line numbers not allowed"); break; case EFEXISTS: remark ("File already exists"); break; case EBADCOL: remark ("Improper column number specification"); break; case ESE_NOLANG: remark ("Unknown source language"); break; case ETRUNC: remark ("Lines were truncated"); break; case ESE_NOSHELL: remark ("Type control-q to rebuild screen"); break; case ECANTFORK: remark ("Can't fork --- get help!"); break; case ESE_NOSUB: remark ("No saved replacement --- sorry"); break; case ESE_NOCMD: remark ("No saved shell command --- sorry"); break; default: remark ("?"); break; } Errcode = ESE_NOSE_ERR; }
void IOSCfgParser::ip_access_list_ext() { ANTLR_USE_NAMESPACE(antlr)RefToken name = ANTLR_USE_NAMESPACE(antlr)nullToken; try { // for error handling match(ACCESS_LIST); match(EXTENDED); name = LT(1); match(WORD); if ( inputState->guessing==0 ) { #line 238 "iosacl.g" importer->newUnidirRuleSet( name->getText(), libfwbuilder::Policy::TYPENAME ); *dbg << name->getLine() << ":" << " ACL ext " << name->getText() << std::endl; #line 608 "IOSCfgParser.cpp" } match(NEWLINE); { // ( ... )* for (;;) { switch ( LA(1)) { case PERMIT: { permit_ext(); break; } case DENY: { deny_ext(); break; } case REMARK: { remark(); break; } default: if ((LA(1) == LINE_COMMENT) && (_tokenSet_1.member(LA(2)))) { comment(); } else if ((LA(1) == NEWLINE) && (_tokenSet_1.member(LA(2)))) { match(NEWLINE); } else { goto _loop18; } } } _loop18:; } // ( ... )* if ( inputState->guessing==0 ) { #line 255 "iosacl.g" *dbg << LT(0)->getLine() << ":" << " ACL end" << std::endl << std::endl; #line 649 "IOSCfgParser.cpp" } } catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { if( inputState->guessing == 0 ) { reportError(ex); recover(ex,_tokenSet_2); } else { throw; } } }
void sch_door(POINT point[SPOTNUM],int star_fini_flag,int *point1) { int mouse_x=320,mouse_y=175,mouse_key=0; int i,flag=0; init_point(point); draw_bar(492,55,637,345,LIGHTGRAY); initmouse(492,637,55,159); cursor(mouse_x,mouse_y); while(1) { newmouse(&mouse_x,&mouse_y,&mouse_key); if(mouse_x>495&&mouse_x<635&&mouse_y>60&&mouse_y<78&&flag==1) { cursor(mouse_x,mouse_y); dis_hz(495,60,point[15].name,0,20,LIGHTRED); remark(point[15].remarks); flag=0; cursor(mouse_x,mouse_y); } if(mouse_x>495&&mouse_x<635&&mouse_y>80&&mouse_y<98&&flag==1) { cursor(mouse_x,mouse_y); remark(point[16].remarks); dis_hz(495,80,point[16].name,0,20,LIGHTRED); flag=0; cursor(mouse_x,mouse_y); } if(mouse_x>495&&mouse_x<635&&mouse_y>100&&mouse_y<118&&flag==1) { cursor(mouse_x,mouse_y); dis_hz(495,100,point[17].name,0,20,LIGHTRED); remark(point[17].remarks); flag=0; cursor(mouse_x,mouse_y); } if(mouse_x>495&&mouse_x<635&&mouse_y>120&&mouse_y<138&&flag==1) { cursor(mouse_x,mouse_y); dis_hz(495,120,point[18].name,0,20,LIGHTRED); remark(point[18].remarks); flag=0; cursor(mouse_x,mouse_y); } if(mouse_x>495&&mouse_x<635&&mouse_y>140&&mouse_y<158&&flag==1) { cursor(mouse_x,mouse_y); dis_hz(495,140,point[19].name,0,20,LIGHTRED); remark(point[19].remarks); flag=0; cursor(mouse_x,mouse_y); } if(!(mouse_x>495&&mouse_x<635&&mouse_y>60&&mouse_y<78)&&!(mouse_x>495&&mouse_x<635&&mouse_y>80&&mouse_y<98)&& !(mouse_x>495&&mouse_x<635&&mouse_y>100&&mouse_y<118)&&!(mouse_x>495&&mouse_x<635&&mouse_y>120&&mouse_y<138)&& !(mouse_x>495&&mouse_x<635&&mouse_y>140&&mouse_y<158)&&!(mouse_x>=495&&mouse_x<=635&&mouse_y>=160&&mouse_y<=240)) { flag=1; for(i=0;i<5;i++) dis_hz(495,60+20*i,point[i+15].name,0,20,WHITE); draw_bar1(495,160,634,240,LIGHTGRAY); } if(mouse_x>495&&mouse_x<635&&mouse_y>60&&mouse_y<78&&mouse_key==1) { cursor(mouse_x,mouse_y); cursor(mouse_x,mouse_y); cursor(mouse_x,mouse_y); *point1=15; remark(point[15].remarks); show_sta_fin(point[15].name,star_fini_flag); break; } if(mouse_x>495&&mouse_x<635&&mouse_y>80&&mouse_y<98&&mouse_key==1) { cursor(mouse_x,mouse_y); cursor(mouse_x,mouse_y); cursor(mouse_x,mouse_y); *point1=16; remark(point[16].remarks); show_sta_fin(point[16].name,star_fini_flag); break; } if(mouse_x>495&&mouse_x<635&&mouse_y>100&&mouse_y<118&&mouse_key==1) { cursor(mouse_x,mouse_y); cursor(mouse_x,mouse_y); cursor(mouse_x,mouse_y); *point1=17; remark(point[17].remarks); show_sta_fin(point[17].name,star_fini_flag); break; } if(mouse_x>495&&mouse_x<635&&mouse_y>120&&mouse_y<138&&mouse_key==1) { cursor(mouse_x,mouse_y); cursor(mouse_x,mouse_y); cursor(mouse_x,mouse_y); *point1=18; remark(point[18].remarks); show_sta_fin(point[18].name,star_fini_flag); break; } if(mouse_x>495&&mouse_x<635&&mouse_y>140&&mouse_y<158&&mouse_key==1) { cursor(mouse_x,mouse_y); cursor(mouse_x,mouse_y); cursor(mouse_x,mouse_y); *point1=19; remark(point[19].remarks); show_sta_fin(point[19].name,star_fini_flag); break; } } }
void sasio::Files:: write_pdb(const std::string &filename, int &frame) { std::ofstream outfile(filename) ; std::string time_and_user_string ; time_and_user_string = util::time_and_user(); std::string temp_remark = "REMARK PDB FILE WRITTEN "; temp_remark += time_and_user_string ; std::string remark(temp_remark,0,80) ; std::cout << remark << std::endl ; outfile << remark << std::endl; //std::string dum1 =" 1 2 3 4 5 6 7 8"; //std::string dum2 ="12345678901234567890123456789012345678901234567890123456789012345678901234567890"; //outfile << dum1 << std::endl; //outfile << dum2 << std::endl; std::stringstream line ; std::stringstream my_stringstream; for(int i = 0 ; i < _natoms() ; ++i) { line.str( std::string() ); line.clear() ; std::string tmp(_atom_record()[i],0,6) ; line << std::setfill(' ') << std::setw(6) << tmp ; if(_atom_index()[i] > 99999) { std::string tmp2(std::to_string(99999),0,5) ; line << std::setfill(' ') << std::setw(5) << std::right << tmp2 ; } else if(_atom_index()[i] < -9999) { std::string tmp2(std::to_string(-9999),0,5) ; line << std::setfill(' ') << std::setw(5) << std::right << tmp2 ; } else { std::string tmp2(std::to_string(_atom_index()[i]),0,5) ; line << std::setfill(' ') << std::setw(5) << std::right << tmp2 ; } std::string tmp0 = " "; line << tmp0 ; std::string tmp3(_atom_name()[i],0,4) ; line << std::setfill(' ') << std::setw(4) << std::left << tmp3 ; std::string tmp4(_atom_altloc()[i],0,1) ; line << std::setw(1) << tmp4 ; std::string tmp5(_atom_resname()[i],0,3) ; line << std::setfill(' ') << std::setw(4) << std::left << tmp5 ; std::string tmp6(_atom_chain()[i],0,1) ; line << std::setfill(' ') << std::setw(1) << std::left << tmp6 ; if(_atom_resid()[i] > 9999) { std::string tmp7(std::to_string(9999),0,4) ; line << std::setfill(' ') << std::setw(4) << std::right << tmp7 ; } else if(_atom_resid()[i] < -999) { std::string tmp7(std::to_string(-999),0,4) ; line << std::setfill(' ') << std::setw(4) << std::right << tmp7 ; } else { std::string tmp7(std::to_string(_atom_resid()[i]),0,4) ; line << std::setfill(' ') << std::setw(4) << std::right << tmp7 ; } std::string tmp8(_atom_icode()[i],0,1) ; line << std::setw(4) << std::left << tmp8 ; //std::string f_str = std::to_string(f); //here // my_stringstream << _x()(i,frame) ; //my_stringstream << std::to_string(_x()(i,frame)) ; //line << std::setfill(' ') << std::setw(8) << std::right << my_stringstream.str() ; line << std::setfill(' ') << std::setw(8) << std::right << my_stringstream.str() ; my_stringstream << _y()(i,frame) ; line << my_stringstream.str() ; my_stringstream << _z()(i,frame) ; line << my_stringstream.str() ; std::string tmp12(_atom_occupancy()[i],0,6) ; line << std::setfill(' ') << std::setw(6) << std::right << tmp12 ; std::string tmp13(_atom_beta()[i],0,6) ; line << std::setfill(' ') << std::setw(6) << std::right << tmp13 ; std::string tmp14(_atom_segname()[i],0,4) ; line << std::setfill(' ') << std::setw(10) << std::right << tmp14 ; std::string tmp15(_atom_element()[i],0,2) ; line << std::setfill(' ') << std::setw(2) << std::right << tmp15 ; std::string tmp16(_atom_charge()[i],0,2) ; line << std::setfill(' ') << std::setw(2) << std::right << tmp16 ; outfile << line.str() << std::endl ; } outfile << "END" << std::endl; outfile.close() ; }