/*
 File: eval_phrases.cpp
 Date and Time: Fri Jan 30 18:55:11 2015 
*/
#include "eval_phrases.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_eval_phrases;// grammar's ns
// first set terminals
fsm_rules_reuse_table_type::fsm_rules_reuse_table_type(){
 no_rules_entries_ = 9;
 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();
 per_rule_s_table_[6] =  new Per_rule_s_reuse_table();
 per_rule_s_table_[7] =  new Per_rule_s_reuse_table();
 per_rule_s_table_[8] =  new Per_rule_s_reuse_table();
}
  Ceval_phrases::
  Ceval_phrases()
    :yacco2::CAbs_fsm
      ("eval_phrases.lex"
      ,"1.0"
      ,"8 Mar. 2006"
      ,true
      ,"Evaluate parse phrase sequencer: \n as i use a top / down approach to dispatching the various phrases."
      ,"Fri Jan 30 18:55:11 2015 "
      ,S1_Ceval_phrases){
    
  }
 
Ceval_phrases::~Ceval_phrases(){

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

  bool Ceval_phrases::failed(){
      return false;
  }
  void Ceval_phrases::op(){
	  gps_=0;
	
}
int Ceval_phrases::rhs_to_rules_mapping_[19] = {
 -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
 ,3 // subrule 7 for rule 4
 ,3 // subrule 8 for rule 4
 ,4 // subrule 9 for rule 5
 ,4 // subrule 10 for rule 5
 ,5 // subrule 11 for rule 6
 ,5 // subrule 12 for rule 6
 ,6 // subrule 13 for rule 7
 ,6 // subrule 14 for rule 7
 ,7 // subrule 15 for rule 8
 ,7 // subrule 16 for rule 8
 ,8 // subrule 17 for rule 9
 ,8 // subrule 18 for rule 9
}; 

	void Ceval_phrases::post_error(CAbs_lr1_sym* Err){
	  using namespace NS_yacco2_T_enum;
	  Err->set_rc(*gps_,__FILE__,__LINE__);
	  if(gps_->enumerated_id__ == T_Enum::T_LR1_eog_){
			Err->set_line_no_and_pos_in_line(1,1);
	  }
	    parser__->add_token_to_error_queue(*Err);
	    parser__->set_abort_parse(true); 
	}

	void Ceval_phrases::post_gps(CAbs_lr1_sym* Sym){
	  gps_ = Sym;
	}
	
Reval_phrases::Reval_phrases(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Reval_phrases",0,Ceval_phrases::R_Reval_phrases_,P,false,false){
}

void Reval_phrases::sr2(){
  struct SF{
   LR1_eog* 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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
    fsm->post_error(new Err_empty_file);
    fsm->post_gps(sf->p1__);
  
}

Rfsm_phrase::Rfsm_phrase(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rfsm_phrase",0,Ceval_phrases::R_Rfsm_phrase_,P,false,false){
}

void Rfsm_phrase::sr1(){
  struct SF{
   T_fsm_phrase* 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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
    fsm->post_gps(sf->p1__);
  
}

void Rfsm_phrase::sr2(){
  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);
  
   	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
   fsm->post_gps(sf->p1__);
    fsm->post_error(new ERR_no_fsm_phrase);
  
}

Rparallel_phrase::Rparallel_phrase(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rparallel_phrase",0,Ceval_phrases::R_Rparallel_phrase_,P,false,false){
}

void Rparallel_phrase::sr1(){
  struct SF{
   T_parallel_parser_phrase* 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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
    fsm->post_gps(sf->p1__);
  
}

RT_enum_phrase::RT_enum_phrase(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("RT_enum_phrase",0,Ceval_phrases::R_RT_enum_phrase_,P,false,false){
}

void RT_enum_phrase::sr1(){
  struct SF{
   T_enum_phrase* 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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
    fsm->post_gps(sf->p1__);
  
}

void RT_enum_phrase::sr2(){
  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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
    fsm->post_gps(sf->p1__);
     fsm->post_error(new ERR_no_T_enum_phrase);
  
}

Rerr_sym_phrase::Rerr_sym_phrase(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rerr_sym_phrase",0,Ceval_phrases::R_Rerr_sym_phrase_,P,false,false){
}

void Rerr_sym_phrase::sr1(){
  struct SF{
   T_error_symbols_phrase* 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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
    fsm->post_gps(sf->p1__);
  
}

void Rerr_sym_phrase::sr2(){
  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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
     fsm->post_gps(sf->p1__);
     fsm->post_error(new ERR_no_errors_phrase);
  
}

Rrc_phrase::Rrc_phrase(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rrc_phrase",0,Ceval_phrases::R_Rrc_phrase_,P,false,false){
}

void Rrc_phrase::sr1(){
  struct SF{
   T_rc_phrase* 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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
    fsm->post_gps(sf->p1__);
  
}

void Rrc_phrase::sr2(){
  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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
    fsm->post_gps(sf->p1__);
     fsm->post_error(new ERR_no_rc_phrase);
  
}

Rlr1_k_phrase::Rlr1_k_phrase(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rlr1_k_phrase",0,Ceval_phrases::R_Rlr1_k_phrase_,P,false,false){
}

void Rlr1_k_phrase::sr1(){
  struct SF{
   T_lr1_k_phrase* 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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
    fsm->post_gps(sf->p1__);
  
}

void Rlr1_k_phrase::sr2(){
  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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
    fsm->post_gps(sf->p1__);
     fsm->post_error(new ERR_no_lrk_phrase);
  
}

Rterms_phrase::Rterms_phrase(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rterms_phrase",0,Ceval_phrases::R_Rterms_phrase_,P,false,false){
}

void Rterms_phrase::sr1(){
  struct SF{
   T_terminals_phrase* 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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
    fsm->post_gps(sf->p1__);
  
}

void Rterms_phrase::sr2(){
  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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
    fsm->post_gps(sf->p1__);
     fsm->post_error(new ERR_no_terminals_phrase);
  
}

Rrules_phrase::Rrules_phrase(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rrules_phrase",0,Ceval_phrases::R_Rrules_phrase_,P,false,false){
}

void Rrules_phrase::sr1(){
  struct SF{
   T_rules_phrase* 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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
    fsm->post_gps(sf->p1__);
  
}

void Rrules_phrase::sr2(){
  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);
  
  	Ceval_phrases* fsm = (Ceval_phrases*) rule_info__.parser__->fsm_tbl__;
    fsm->post_gps(sf->p1__);
     fsm->post_error(new ERR_no_rules_phrase);
  
}

