summaryrefslogtreecommitdiff
path: root/web/yacco2/grammar-testsuite/testout_err_hdlr.cpp
blob: 57bd6043575da78905ebca930628ffea0599c8e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
 File: testout_err_hdlr.cpp
 Date and Time: Sat Jan 31 11:59:00 2015 
*/
#include "testout_err_hdlr.h"
using namespace NS_testout_T_enum;// enumerate
using namespace NS_testout_err_symbols;// error symbols
using namespace NS_yacco2_k_symbols;// lrk 
using namespace NS_testout_terminals;// terminals
using namespace NS_yacco2_characters;// rc 
using namespace yacco2;// yacco2 library
using namespace NS_testout_err_hdlr;// 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();
}
  Ctestout_err_hdlr::
  Ctestout_err_hdlr()
    :yacco2::CAbs_fsm
      ("testout_err_hdlr.lex"
      ,"1.0"
      ,"8 Jul 2003"
      ,false
      ,"Logic sequencer: Print out errors from testout grammars - pager_1."
      ,"Sat Jan 31 11:59:00 2015 "
      ,S1_Ctestout_err_hdlr){
    
  }
 
Ctestout_err_hdlr::~Ctestout_err_hdlr(){

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

  bool Ctestout_err_hdlr::failed(){
      return false;
  }
  void Ctestout_err_hdlr::op(){
}
int Ctestout_err_hdlr::rhs_to_rules_mapping_[8] = {
 -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
 ,2 // subrule 7 for rule 3
}; 
Rtestout_err_hdlr::Rtestout_err_hdlr(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rtestout_err_hdlr",0,Ctestout_err_hdlr::R_Rtestout_err_hdlr_,P,false,false){
}

Rerrors::Rerrors(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rerrors",0,Ctestout_err_hdlr::R_Rerrors_,P,false,false){
}

Rerror::Rerror(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rerror",0,Ctestout_err_hdlr::R_Rerror_,P,false,false){
}

void Rerror::sr1(){
  struct SF{
   Err_no_filename* 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);
  
   error_where(sf->p1__);
   yacco2::lrclog << "\t" << sf->p1__->id__ << std::endl;
   std::cout << "\t" << sf->p1__->id__ << std::endl;
  
}

void Rerror::sr2(){
  struct SF{
   Err_bad_filename* 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);
  
   error_where(sf->p1__);
   yacco2::lrclog << "\t" << sf->p1__->id__
   << " filename: \"" << sf->p1__->file_name()->c_str()
   << "\" does not exist" << std::endl;
   std::cout << "\t" << sf->p1__->id__
   << " filename: \"" << sf->p1__->file_name()->c_str()
   << "\" does not exist" << std::endl;
  
}

void Rerror::sr3(){
  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);
  
   error_where(sf->p1__);
   yacco2::lrclog << "\t" << sf->p1__->id__ << std::endl;
   std::cout << "\t" << sf->p1__->id__ << std::endl;
  
}