/*
 File: la_expr_lexical.cpp
 Date and Time: Fri Jan 30 18:55:13 2015 
*/
#include "la_expr_lexical.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_la_expr_lexical;// 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();
}
  Cla_expr_lexical::
  Cla_expr_lexical()
    :yacco2::CAbs_fsm
      ("la_expr_lexical.lex"
      ,"1.0"
      ,"24 mar 2004"
      ,false
      ,"Lexer: 2nd stage lexing for lookahead: stripper..."
      ,"Fri Jan 30 18:55:13 2015 "
      ,S1_Cla_expr_lexical){
    
  }
 
Cla_expr_lexical::~Cla_expr_lexical(){

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

  bool Cla_expr_lexical::failed(){
      return false;
  }
  void Cla_expr_lexical::op(){
}
int Cla_expr_lexical::rhs_to_rules_mapping_[10] = {
 -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
 ,2 // subrule 6 for rule 3
 ,2 // subrule 7 for rule 3
 ,2 // subrule 8 for rule 3
 ,2 // subrule 9 for rule 3
}; 
Rstripper::Rstripper(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rstripper",0,Cla_expr_lexical::R_Rstripper_,P,false,false){
}

void Rstripper::op(){
  sstrace_rulesss
 
    using namespace NS_yacco2_k_symbols;
    ADD_TOKEN_TO_PRODUCER_QUEUE(*yacco2::PTR_LR1_eog__);   
    ADD_TOKEN_TO_PRODUCER_QUEUE(*yacco2::PTR_LR1_eog__);  
  
}
Rtoks::Rtoks(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rtoks",0,Cla_expr_lexical::R_Rtoks_,P,false,false){
}

Rtok::Rtok(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rtok",0,Cla_expr_lexical::R_Rtok_,P,false,false){
}

void Rtok::sr1(){
  struct SF{
   T_identifier* 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);
  
          using namespace yacco2_stbl;
		T_sym_tbl_report_card report_card;
		find_sym_in_stbl(report_card,*sf->p1__->identifier()->c_str());
		if(report_card.action_ == T_sym_tbl_report_card::not_fnd){
		  CAbs_lr1_sym* sym = new Err_bad_term_in_la_expr;
          sym->set_rc(*sf->p1__,__FILE__,__LINE__);
          ADD_TOKEN_TO_ERROR_QUEUE(*sym);
          rule_info__.parser__->set_stop_parse(true);
          return;
		}
       ADD_TOKEN_TO_PRODUCER_QUEUE(*report_card.tbl_entry_->symbol_);
    
}

void Rtok::sr2(){
  struct SF{
   T_c_string* 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);
  
          using namespace yacco2_stbl;
		T_sym_tbl_report_card report_card;
		find_sym_in_stbl(report_card,*sf->p1__->c_string()->c_str());
		if(report_card.action_ == T_sym_tbl_report_card::not_fnd){
		  CAbs_lr1_sym* sym = new Err_bad_term_in_la_expr;
          sym->set_rc(*sf->p1__,__FILE__,__LINE__);
          ADD_TOKEN_TO_ERROR_QUEUE(*sym);
          rule_info__.parser__->set_stop_parse(true);
          return;
		}
       ADD_TOKEN_TO_PRODUCER_QUEUE(*report_card.tbl_entry_->symbol_);
    
}

void Rtok::sr3(){
  struct SF{
   T_c_literal* 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);
  
          using namespace yacco2_stbl;
		T_sym_tbl_report_card report_card;
		find_sym_in_stbl(report_card,*sf->p1__->c_literal()->c_str());
		if(report_card.action_ == T_sym_tbl_report_card::not_fnd){
		  CAbs_lr1_sym* sym = new Err_bad_term_in_la_expr;
          sym->set_rc(*sf->p1__,__FILE__,__LINE__);
          ADD_TOKEN_TO_ERROR_QUEUE(*sym);
          rule_info__.parser__->set_stop_parse(true);
          return;
		}
       ADD_TOKEN_TO_PRODUCER_QUEUE(*report_card.tbl_entry_->symbol_);
    
}

void Rtok::sr4(){
  struct SF{
   raw_plus* 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);
  
       ADD_TOKEN_TO_PRODUCER_QUEUE(*sf->p1__); 
    
}

void Rtok::sr5(){
  struct SF{
   raw_minus* 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);
  
       ADD_TOKEN_TO_PRODUCER_QUEUE(*sf->p1__); 
    
}

void Rtok::sr6(){
  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);
  
    ADD_TOKEN_TO_PRODUCER_QUEUE(*sf->p1__);
    
}

