/*
 File: la_expr_src.cpp
 Date and Time: Fri Jan 30 18:55:13 2015 
*/
#include "la_expr_src.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_src;// grammar's ns
// first set terminals
fsm_rules_reuse_table_type::fsm_rules_reuse_table_type(){
 no_rules_entries_ = 5;
 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();
}
  Cla_expr_src::
  Cla_expr_src()
    :yacco2::CAbs_fsm
      ("la_expr_src.lex"
      ,"1.0"
      ,"30 dec 2002"
      ,false
      ,"Lexer: 1st stage of Lookahead source expression\n converted into raw character tokens for post evaluation."
      ,"Fri Jan 30 18:55:13 2015 "
      ,S1_Cla_expr_src){
    
    exp_ = 0;
  
  }
 
Cla_expr_src::~Cla_expr_src(){

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

  bool Cla_expr_src::failed(){
      return false;
  }
  void Cla_expr_src::op(){
    exp_ = new T_la_expr_src;
    exp_->set_rc(*parser__->start_token__,__FILE__,__LINE__);
    parser__->set_use_all_shift_on();
  
}
int Cla_expr_src::rhs_to_rules_mapping_[20] = {
 -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
 ,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
 ,3 // subrule 16 for rule 4
 ,3 // subrule 17 for rule 4
 ,4 // subrule 18 for rule 5
 ,4 // subrule 19 for rule 5
}; 
Rla_expr_src::Rla_expr_src(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rla_expr_src",0,Cla_expr_src::R_Rla_expr_src_,P,false,false){
}

Rtoks::Rtoks(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rtoks",0,Cla_expr_src::R_Rtoks_,P,false,false){
}

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

void Rtok::sr1(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   T_c_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);
  
      Cla_expr_src* fsm = (Cla_expr_src*)rule_info__.parser__->fsm_tbl__;
      fsm->exp_->la_tok_can()->push_back(*sf->p2__);
    
}

void Rtok::sr2(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   T_c_literal* 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);
  
      Cla_expr_src* fsm = (Cla_expr_src*)rule_info__.parser__->fsm_tbl__;
      fsm->exp_->la_tok_can()->push_back(*sf->p2__);
    
}

void Rtok::sr3(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   T_eocode* 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);
  
	Cla_expr_src* fsm = (Cla_expr_src*)rule_info__.parser__->fsm_tbl__;
      T_eocode* k = sf->p2__;
       k->set_auto_delete(true);
      rule_info__.parser__->set_use_all_shift_off();
		fsm->exp_->la_tok_can()->push_back(*yacco2::PTR_LR1_eog__);
		fsm->exp_->la_tok_can()->push_back(*yacco2::PTR_LR1_eog__);
		RSVP(fsm->exp_);
		fsm->exp_=0;
		rule_info__.parser__->set_stop_parse(true);
    
}

void Rtok::sr4(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   T_identifier* 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);
  
      Cla_expr_src* fsm = (Cla_expr_src*)rule_info__.parser__->fsm_tbl__;
      fsm->exp_->la_tok_can()->push_back(*sf->p2__);
    
}

void Rtok::sr5(){
  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);
  
      Cla_expr_src* fsm = (Cla_expr_src*)rule_info__.parser__->fsm_tbl__;
		CAbs_lr1_sym* la_sym = sf->p1__;
		using namespace NS_yacco2_T_enum;
		using namespace NS_yacco2_terminals;
		int id = la_sym->enumerated_id__;
		if(id == T_Enum::T_LR1_eog_){
			CAbs_lr1_sym* sym = new Err_no_end_of_code;
			sym->set_rc(*la_sym,__FILE__,__LINE__);
			RSVP(sym);
			rule_info__.parser__->set_stop_parse(true);
			return;
		}
      fsm->exp_->la_tok_can()->push_back(*la_sym);
    
}

void Rtok::sr6(){
  struct SF{
   LR1_parallel_operator* 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);
  
       RSVP(sf->p2__);
       rule_info__.parser__->set_stop_parse(true);
    
}

void Rtok::sr7(){
  struct SF{
   LR1_parallel_operator* 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);
  
       RSVP(sf->p2__);
       rule_info__.parser__->set_stop_parse(true);
    
}

void Rtok::sr8(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   Err_comment_overrun* 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);
  
       RSVP(sf->p2__);
       rule_info__.parser__->set_stop_parse(true);
    
}

void Rtok::sr9(){
  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);
  
    Cla_expr_src* fsm = (Cla_expr_src*)rule_info__.parser__->fsm_tbl__;
      fsm->exp_->la_tok_can()->push_back(*sf->p2__);
   
}

void Rtok::sr10(){
  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);
  
      Cla_expr_src* fsm = (Cla_expr_src*)rule_info__.parser__->fsm_tbl__;
      fsm->exp_->la_tok_can()->push_back(*sf->p1__);
    
}

void Rtok::sr11(){
  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);
  
      Cla_expr_src* fsm = (Cla_expr_src*)rule_info__.parser__->fsm_tbl__;
      fsm->exp_->la_tok_can()->push_back(*sf->p1__);
    
}

Rlint::Rlint(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rlint",0,Cla_expr_src::R_Rlint_,P,false,false){
}

Rla_minus::Rla_minus(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rla_minus",0,Cla_expr_src::R_Rla_minus_,P,false,false){
}

