/*
 File: o2_linker_opts.cpp
 Date and Time: Fri Jan 30 18:55:17 2015 
*/
#include "o2_linker_opts.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_linker_opts;// grammar's ns
// first set terminals
fsm_rules_reuse_table_type::fsm_rules_reuse_table_type(){
 no_rules_entries_ = 6;
 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();
 per_rule_s_table_[3] =  new Per_rule_s_reuse_table();
 per_rule_s_table_[4] =  new Per_rule_s_reuse_table();
 per_rule_s_table_[5] =  new Per_rule_s_reuse_table();
}
  Co2_linker_opts::
  Co2_linker_opts()
    :yacco2::CAbs_fsm
      ("o2_linker_opts.lex"
      ,"1.0"
      ,"21 Nov. 2002"
      ,false
      ,"\\Olinker's Command line options parser."
      ,"Fri Jan 30 18:55:17 2015 "
      ,S1_Co2_linker_opts){
    
    file_to_compile_.clear();
  
  }
 
Co2_linker_opts::~Co2_linker_opts(){

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

  bool Co2_linker_opts::failed(){
      return false;
  }
  void Co2_linker_opts::op(){
    parser__->set_use_all_shift_on();
    file_to_compile_.clear();
  
}
int Co2_linker_opts::rhs_to_rules_mapping_[16] = {
 -1
 ,0 // subrule 1 for rule 1
 ,1 // subrule 2 for rule 2
 ,1 // subrule 3 for rule 2
 ,2 // subrule 4 for rule 3
 ,2 // subrule 5 for rule 3
 ,3 // subrule 6 for rule 4
 ,3 // subrule 7 for rule 4
 ,4 // subrule 8 for rule 5
 ,4 // subrule 9 for rule 5
 ,4 // subrule 10 for rule 5
 ,4 // subrule 11 for rule 5
 ,5 // subrule 12 for rule 6
 ,5 // subrule 13 for rule 6
 ,5 // subrule 14 for rule 6
 ,5 // subrule 15 for rule 6
}; 
Ro2_lcl_opts::Ro2_lcl_opts(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Ro2_lcl_opts",0,Co2_linker_opts::R_Ro2_lcl_opts_,P,false,false){
}

void Ro2_lcl_opts::op(){
  sstrace_rulesss
 
    TOKEN_GAGGLE* err_queue = (TOKEN_GAGGLE*)rule_info__.parser__->error_queue();
    if(err_queue ->empty()) return;
  
}
Rextra_chaffe::Rextra_chaffe(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rextra_chaffe",0,Co2_linker_opts::R_Rextra_chaffe_,P,false,false){
}

void Rextra_chaffe::sr2(){
  
      rule_info__.parser__->set_use_all_shift_off();
      CAbs_lr1_sym* sym = new Err_cmd_line_chaffe();
      sym->set_rc(*rule_info__.parser__->current_token(),__FILE__,__LINE__);
      ADD_TOKEN_TO_ERROR_QUEUE(*sym);
      rule_info__.parser__->set_stop_parse(true);
    
}

Rws_k::Rws_k(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rws_k",0,Co2_linker_opts::R_Rws_k_,P,false,false){
}

Rws_k_s::Rws_k_s(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rws_k_s",0,Co2_linker_opts::R_Rws_k_s_,P,false,false){
}

Rws::Rws(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rws",0,Co2_linker_opts::R_Rws_,P,false,false){
}

void Rws::sr2(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   T_comment* 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);
  
      sf->p2__->set_auto_delete(true);
    
}

void Rws::sr3(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   T_eol* 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);
  
      sf->p2__->set_auto_delete(true);
    
}

void Rws::sr4(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   CAbs_lr1_sym* 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);
  
      rule_info__.parser__->set_use_all_shift_off();
      ADD_TOKEN_TO_ERROR_QUEUE(*sf->p2__);
      rule_info__.parser__->set_stop_parse(true);
    
}

Rfile::Rfile(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rfile",0,Co2_linker_opts::R_Rfile_,P,false,false){
}

void Rfile::sr1(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   T_unquoted_string* 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);
  
      T_unquoted_string* uqstr = sf->p2__;
      Co2_linker_opts* fsm = (Co2_linker_opts*)rule_info__.parser__->fsm_tbl__;      
      fsm->file_to_compile_ += uqstr->unquoted_string()->c_str();
      edit_file(uqstr);
      sf->p2__->set_auto_delete(true);
    
}

void Rfile::sr2(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   CAbs_lr1_sym* 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);
  
      rule_info__.parser__->set_use_all_shift_off();
      ADD_TOKEN_TO_ERROR_QUEUE(*sf->p2__);
    
}

void Rfile::sr3(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   T_xc_str* 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);
  
      T_xc_str* xcstr = sf->p2__;
      Co2_linker_opts* fsm = (Co2_linker_opts*)rule_info__.parser__->fsm_tbl__;      
      fsm->file_to_compile_ += xcstr->c_string()->c_str();
      edit_file(xcstr);
    
}

void Rfile::sr4(){
  
      rule_info__.parser__->set_use_all_shift_off();
      CAbs_lr1_sym* sym = new Err_no_filename();
        sym->set_rc(*rule_info__.parser__->current_token(),__FILE__,__LINE__);
        ADD_TOKEN_TO_ERROR_QUEUE(*sym);
        rule_info__.parser__->set_stop_parse(true);
    
}

