/*
 File: testout_err_hdlr.cpp
 Date and Time: Sat Jan 31 11:59:00 2015 
*/
#include "testout_err_hdlr.h"
using namespace NS_testout_T_enum;// enumerate
using namespace NS_testout_err_symbols;// error symbols
using namespace NS_yacco2_k_symbols;// lrk 
using namespace NS_testout_terminals;// terminals
using namespace NS_yacco2_characters;// rc 
using namespace yacco2;// yacco2 library
using namespace NS_testout_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();
}
  Ctestout_err_hdlr::
  Ctestout_err_hdlr()
    :yacco2::CAbs_fsm
      ("testout_err_hdlr.lex"
      ,"1.0"
      ,"8 Jul 2003"
      ,false
      ,"Logic sequencer: Print out errors from testout grammars - pager_1."
      ,"Sat Jan 31 11:59:00 2015 "
      ,S1_Ctestout_err_hdlr){
    
  }
 
Ctestout_err_hdlr::~Ctestout_err_hdlr(){

  for(int x = 0;x < 3;++x){
   ///delete fsm_rules_reuse_table.per_rule_s_table_[x];
  }
} 

  bool Ctestout_err_hdlr::failed(){
      return false;
  }
  void Ctestout_err_hdlr::op(){
}
int Ctestout_err_hdlr::rhs_to_rules_mapping_[8] = {
 -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
}; 
Rtestout_err_hdlr::Rtestout_err_hdlr(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rtestout_err_hdlr",0,Ctestout_err_hdlr::R_Rtestout_err_hdlr_,P,false,false){
}

Rerrors::Rerrors(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rerrors",0,Ctestout_err_hdlr::R_Rerrors_,P,false,false){
}

Rerror::Rerror(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rerror",0,Ctestout_err_hdlr::R_Rerror_,P,false,false){
}

void Rerror::sr1(){
  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::sr2(){
  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::sr3(){
  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;
  
}

