/*
 File: unq_str.cpp
 Date and Time: Fri Jan 30 18:55:27 2015 
*/
#include "unq_str.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_unq_str;// 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();
}
  Cunq_str::
  Cunq_str()
    :yacco2::CAbs_fsm
      ("unq_str.lex"
      ,"1.0"
      ,"29 Nov. 2002"
      ,false
      ,"Unquoted string of characters: raw and basic."
      ,"Fri Jan 30 18:55:27 2015 "
      ,S1_Cunq_str){
    
  }
 
Cunq_str::~Cunq_str(){

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

  bool Cunq_str::failed(){
      return false;
  }
  void Cunq_str::op(){
	  parser__->set_use_all_shift_on();
	  c_.erase();
	  if(la_bnds_fnd(parser__->start_token__) == true)
	    parser__->set_use_all_shift_off();// stop the parse
	
}
int Cunq_str::rhs_to_rules_mapping_[5] = {
 -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
}; 
Runq_str::Runq_str(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Runq_str",0,Cunq_str::R_Runq_str_,P,false,false){
}

void Runq_str::sr1(){
  
	  Cunq_str* fsm = (Cunq_str*)rule_info__.parser__->fsm_tbl__;	  
      CAbs_lr1_sym* sym = new T_unquoted_string(fsm->c_);
      sym->set_rc(*rule_info__.parser__->start_token__,__FILE__,__LINE__);
      RSVP(sym);
    
}

Rchr::Rchr(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rchr",0,Cunq_str::R_Rchr_,P,false,false){
}

Rall_shift::Rall_shift(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rall_shift",0,Cunq_str::R_Rall_shift_,P,false,false){
}

void Rall_shift::sr1(){
  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);
  
	  Cunq_str* fsm = (Cunq_str*)rule_info__.parser__->fsm_tbl__;	  
	  CAbs_lr1_sym* sym = sf->p1__;
	  fsm->c_ += sym->id__;
	  if(fsm->la_bnds_fnd(rule_info__.parser__->current_token()) == true){// chk LA
	    rule_info__.parser__->set_use_all_shift_off();
	  }
	
}

