/* File: o2_err_hdlr.cpp Date and Time: Fri Jan 30 18:55:16 2015 */ #include "o2_err_hdlr.h" using namespace NS_yacco2_T_enum;// enumerate using namespace NS_yacco2_err_symbols;// error symbols using namespace NS_yacco2_k_symbols;// lrk using namespace NS_yacco2_terminals;// terminals using namespace NS_yacco2_characters;// rc using namespace yacco2;// yacco2 library using namespace NS_o2_err_hdlr;// grammar's ns // first set terminals fsm_rules_reuse_table_type::fsm_rules_reuse_table_type(){ no_rules_entries_ = 3; per_rule_s_table_[0] = new Per_rule_s_reuse_table(); per_rule_s_table_[1] = new Per_rule_s_reuse_table(); per_rule_s_table_[2] = new Per_rule_s_reuse_table(); } Co2_err_hdlr:: Co2_err_hdlr() :yacco2::CAbs_fsm ("o2_err_hdlr.lex" ,"1.0" ,"8 Jul 2003" ,false ,"Logic sequencer: Print out errors from \\O2." ,"Fri Jan 30 18:55:16 2015 " ,S1_Co2_err_hdlr){ } Co2_err_hdlr::~Co2_err_hdlr(){ for(int x = 0;x < 3;++x){ ///delete fsm_rules_reuse_table.per_rule_s_table_[x]; } } bool Co2_err_hdlr::failed(){ return false; } void Co2_err_hdlr::op(){ } int Co2_err_hdlr::rhs_to_rules_mapping_[23] = { -1 ,0 // subrule 1 for rule 1 ,0 // subrule 2 for rule 1 ,1 // subrule 3 for rule 2 ,1 // subrule 4 for rule 2 ,2 // subrule 5 for rule 3 ,2 // subrule 6 for rule 3 ,2 // subrule 7 for rule 3 ,2 // subrule 8 for rule 3 ,2 // subrule 9 for rule 3 ,2 // subrule 10 for rule 3 ,2 // subrule 11 for rule 3 ,2 // subrule 12 for rule 3 ,2 // subrule 13 for rule 3 ,2 // subrule 14 for rule 3 ,2 // subrule 15 for rule 3 ,2 // subrule 16 for rule 3 ,2 // subrule 17 for rule 3 ,2 // subrule 18 for rule 3 ,2 // subrule 19 for rule 3 ,2 // subrule 20 for rule 3 ,2 // subrule 21 for rule 3 ,2 // subrule 22 for rule 3 }; Ro2_err_hdlr::Ro2_err_hdlr(yacco2::Parser* P) :CAbs_lr1_sym ("Ro2_err_hdlr",0,Co2_err_hdlr::R_Ro2_err_hdlr_,P,false,false){ } Rerrors::Rerrors(yacco2::Parser* P) :CAbs_lr1_sym ("Rerrors",0,Co2_err_hdlr::R_Rerrors_,P,false,false){ } Rerror::Rerror(yacco2::Parser* P) :CAbs_lr1_sym ("Rerror",0,Co2_err_hdlr::R_Rerror_,P,false,false){ } void Rerror::sr1(){ struct SF{ Err_nested_files_exceeded* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(1); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__ << " nested number: " << sf->p1__->nested_cnt() << std::endl; std::cout << "\t" << sf->p1__->id__ << " nested number exceeded: " << sf->p1__->nested_cnt() << std::endl; } void Rerror::sr2(){ struct SF{ Err_no_end_of_code* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(1); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__ << std::endl; } void Rerror::sr3(){ struct SF{ Err_no_filename* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(1); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__ << std::endl; } void Rerror::sr4(){ struct SF{ Err_bad_filename* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(1); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__ << " filename: \"" << sf->p1__->file_name()->c_str() << "\" does not exist" << std::endl; std::cout << "\t" << sf->p1__->id__ << " filename: \"" << sf->p1__->file_name()->c_str() << "\" does not exist" << std::endl; } void Rerror::sr5(){ struct SF{ Err_bad_cmd_lne_opt* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(1); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__ << std::endl; } void Rerror::sr6(){ struct SF{ Err_bad_int_no* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(1); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__ << std::endl; } void Rerror::sr7(){ struct SF{ Err_bad_int_no_range* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(1); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__ << std::endl; } void Rerror::sr8(){ struct SF{ Err_no_int_present* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(1); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__ << std::endl; } void Rerror::sr9(){ struct SF{ Err_bad_eos* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(1); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__ << std::endl; } void Rerror::sr10(){ struct SF{ Err_bad_esc* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(1); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__ << std::endl; } void Rerror::sr11(){ struct SF{ Err_comment_overrun* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(1); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__<< std::endl; std::cout << "\t" << sf->p1__->id__ << std::endl; } void Rerror::sr12(){ struct SF{ Err_bad_char* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(1); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__ << std::endl; } void Rerror::sr13(){ struct SF{ Err_bad_univ_seq* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(1); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__ << std::endl; } void Rerror::sr14(){ struct SF{ T_file_inclusion* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; Err_bad_filename* p2__; State* s2__; bool abort2__; Rule_s_reuse_entry* rule_s_reuse_entry2__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__; yacco2::lrclog << " " << sf->p2__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__; std::cout << " " << sf->p2__->id__ << std::endl; } void Rerror::sr15(){ struct SF{ T_file_inclusion* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; Err_bad_esc* p2__; State* s2__; bool abort2__; Rule_s_reuse_entry* rule_s_reuse_entry2__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__; yacco2::lrclog << " " << sf->p2__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__; std::cout << " " << sf->p2__->id__ << std::endl; } void Rerror::sr16(){ struct SF{ T_file_inclusion* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; Err_bad_eos* p2__; State* s2__; bool abort2__; Rule_s_reuse_entry* rule_s_reuse_entry2__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__; yacco2::lrclog << " " << sf->p2__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__; std::cout << " " << sf->p2__->id__ << std::endl; } void Rerror::sr17(){ struct SF{ T_file_inclusion* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; Err_no_filename* p2__; State* s2__; bool abort2__; Rule_s_reuse_entry* rule_s_reuse_entry2__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__; yacco2::lrclog << " " << sf->p2__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__; std::cout << " " << sf->p2__->id__ << std::endl; } void Rerror::sr18(){ struct SF{ CAbs_lr1_sym* p1__; State* s1__; bool abort1__; Rule_s_reuse_entry* rule_s_reuse_entry1__; }; SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(1); error_where(sf->p1__); yacco2::lrclog << "\t" << sf->p1__->id__ << std::endl; std::cout << "\t" << sf->p1__->id__ << std::endl; }