/*
 File: first_set_rules.cpp
 Date and Time: Fri Jan 30 18:55:11 2015 
*/
#include "first_set_rules.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_first_set_rules;// grammar's ns
// first set terminals
fsm_rules_reuse_table_type::fsm_rules_reuse_table_type(){
 no_rules_entries_ = 4;
 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();
}
  Cfirst_set_rules::
  Cfirst_set_rules()
    :yacco2::CAbs_fsm
      ("first_set_rules.lex"
      ,"1.0"
      ,"26 sept. 2005"
      ,false
      ,"Determine first set per rule."
      ,"Fri Jan 30 18:55:11 2015 "
      ,S1_Cfirst_set_rules){
    
  }
 
Cfirst_set_rules::~Cfirst_set_rules(){

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

  bool Cfirst_set_rules::failed(){
      return false;
  }
  void Cfirst_set_rules::op(){
    rule_def_ = 0;
  
}
int Cfirst_set_rules::rhs_to_rules_mapping_[6] = {
 -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
 ,3 // subrule 5 for rule 4
}; 
Rfirst_set_rules::Rfirst_set_rules(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rfirst_set_rules",0,Cfirst_set_rules::R_Rfirst_set_rules_,P,false,false){
}

Rrules::Rrules(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rrules",0,Cfirst_set_rules::R_Rrules_,P,false,false){
}

Rrule::Rrule(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rrule",0,Cfirst_set_rules::R_Rrule_,P,false,false){
}

void Rrule::sr1(){
  
      Cfirst_set_rules* fsm = (Cfirst_set_rules*)rule_info__.parser__->fsm_tbl__;
      GEN_FS_OF_RULE(fsm->rule_def_);
    
}

Rrule_def::Rrule_def(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rrule_def",0,Cfirst_set_rules::R_Rrule_def_,P,false,false){
}

void Rrule_def::sr1(){
  struct SF{
   rule_def* 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);
  
    Cfirst_set_rules* fsm = (Cfirst_set_rules*)rule_info__.parser__->fsm_tbl__;
    fsm->rule_def_ = sf->p1__;
  
}

