/*
 File: la_expr.h
 Date and Time: Fri Jan 30 18:55:13 2015 
*/
#ifndef __la_expr_h__
#define __la_expr_h__ 1
#include "yacco2.h"
#include "yacco2_T_enumeration.h"
#include "yacco2_k_symbols.h"
#include "yacco2_err_symbols.h"
#include "yacco2_terminals.h"
#include "yacco2_characters.h"

#include "o2_externs.h" 
extern void XLATE_SYMBOLS_FOR_cweave(const char* Sym_to_xlate,char* Xlated_sym);
  
// monolithic grammar: no thread
extern yacco2::State S1_Cla_expr;
namespace NS_la_expr {
using namespace NS_yacco2_T_enum;// enumerate
using namespace yacco2;
struct fsm_rules_reuse_table_type{
 fsm_rules_reuse_table_type();
 int no_rules_entries_;
 Per_rule_s_reuse_table* per_rule_s_table_[6];
};
class Cla_expr: public yacco2::CAbs_fsm {
 public:
  enum rules_and_subrules{
   start_of_rule_list = NS_yacco2_T_enum::T_Enum::sum_total_T
   ,R_Rla_expr_ = 569//start_of_rule_list + 0
    ,rhs1_Rla_expr_ = 1
   ,R_Re_ = 570//start_of_rule_list + 2
    ,rhs1_Re_ = 2
    ,rhs2_Re_ = 3
    ,rhs3_Re_ = 4
    ,rhs4_Re_ = 5
   ,R_Rerr_bad_oper_ = 571//start_of_rule_list + 4
    ,rhs1_Rerr_bad_oper_ = 6
   ,R_Rt_ = 572//start_of_rule_list + 6
    ,rhs1_Rt_ = 7
    ,rhs2_Rt_ = 8
    ,rhs3_Rt_ = 9
   ,R_Rminus_ = 573//start_of_rule_list + 8
    ,rhs1_Rminus_ = 10
   ,R_Rplus_ = 574//start_of_rule_list + 10
    ,rhs1_Rplus_ = 11
  };
  //no of la sets = 3
  //no of states = 15
  Cla_expr();
  ~Cla_expr();
  void op();
  bool failed();
  void reduce_rhs_of_rule
      (yacco2::UINT Sub_rule_no,yacco2::Rule_s_reuse_entry** Recycled_rule);
  fsm_rules_reuse_table_type fsm_rules_reuse_table;
  static int rhs_to_rules_mapping_[12];
  
    public: 
    char ddd_[1024*32];
    int ddd_idx_;
    yacco2::CAbs_lr1_sym* gps_for_error_reporting_;
    void copy_str_into_buffer(std::string* Str);
    void copy_kstr_into_buffer(const char* Str);
    void unionize_sets(T_IN_STBL_SET_type* Add_to_set
                      ,T_IN_STBL_SET_type* A_set
                      ,T_IN_STBL_SET_type* B_set);
    void set_differences(T_IN_STBL_SET_type* Add_to_set
                        ,T_IN_STBL_SET_type* A_set
		        ,T_IN_STBL_SET_type* B_set);
    void explode_eolr(T_IN_STBL_SET_type* A_set);
    void add_element_to_set(T_in_stbl* Elem,T_IN_STBL_SET_type* Set_to_add_to);
    void add_rule_to_set
		(NS_yacco2_terminals::rule_def* Rule
		,T_IN_STBL_SET_type* Set_to_add_to
		,std::set<int>* Rules_already_processed);
  
 };
struct Rla_expr;
struct Re;
struct Rerr_bad_oper;
struct Rt;
struct Rminus;
struct Rplus;
struct Rla_expr:public yacco2::CAbs_lr1_sym {
  Rla_expr(yacco2::Parser* P);
  public:
  void sr1();
};

struct Re:public yacco2::CAbs_lr1_sym {
  Re(yacco2::Parser* P);
  void ctor();

    public:
    T_IN_STBL_SET_type fset_;
  
  public:
  void sr1();
  void sr2();
  void sr4();
};

struct Rerr_bad_oper:public yacco2::CAbs_lr1_sym {
  Rerr_bad_oper(yacco2::Parser* P);
  public:
  void sr1();
};

struct Rt:public yacco2::CAbs_lr1_sym {
  Rt(yacco2::Parser* P);
  void ctor();

    public:
    T_IN_STBL_SET_type fset_;
  
  public:
  void sr1();
  void sr2();
  void sr3();
};

struct Rminus:public yacco2::CAbs_lr1_sym {
  Rminus(yacco2::Parser* P);
  public:
  void sr1();
};

struct Rplus:public yacco2::CAbs_lr1_sym {
  Rplus(yacco2::Parser* P);
  public:
  void sr1();
};

} // end of namespace

#endif
