summaryrefslogtreecommitdiff
path: root/web/yacco2/compiler/grammars/link_cleanser.cpp
blob: 8bd502d1e0c01a7cb49ff187d5fa694e076f9f2d (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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
/*
 File: link_cleanser.cpp
 Date and Time: Fri Jan 30 18:55:14 2015 
*/
#include "link_cleanser.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_link_cleanser;// 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();
}
  Clink_cleanser::
  Clink_cleanser()
    :yacco2::CAbs_fsm
      ("link_cleanser.lex"
      ,"1.0"
      ,"17 Apr 2001"
      ,false
      ,"Lexer: \\olinker's cleanser from \n previous lexing to remove chaffe before parsing stage."
      ,"Fri Jan 30 18:55:14 2015 "
      ,S1_Clink_cleanser){
    
  }
 
Clink_cleanser::~Clink_cleanser(){

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

  bool Clink_cleanser::failed(){
      return false;
  }
  void Clink_cleanser::op(){
}
int Clink_cleanser::rhs_to_rules_mapping_[20] = {
 -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
 ,2 // subrule 8 for rule 3
 ,2 // subrule 9 for rule 3
 ,2 // subrule 10 for rule 3
 ,2 // subrule 11 for rule 3
 ,2 // subrule 12 for rule 3
 ,2 // subrule 13 for rule 3
 ,2 // subrule 14 for rule 3
 ,2 // subrule 15 for rule 3
 ,2 // subrule 16 for rule 3
 ,2 // subrule 17 for rule 3
 ,2 // subrule 18 for rule 3
 ,2 // subrule 19 for rule 3
}; 
Rpass3::Rpass3(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rpass3",0,Clink_cleanser::R_Rpass3_,P,false,false){
}

void Rpass3::op(){
  sstrace_rulesss
 
    using namespace NS_yacco2_k_symbols;
    ADD_TOKEN_TO_PRODUCER_QUEUE(*yacco2::PTR_LR1_eog__);   
    ADD_TOKEN_TO_PRODUCER_QUEUE(*yacco2::PTR_LR1_eog__);  
  
}
Relems::Relems(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Relems",0,Clink_cleanser::R_Relems_,P,false,false){
}

Rtoken::Rtoken(yacco2::Parser* P)
 :CAbs_lr1_sym
  ("Rtoken",0,Clink_cleanser::R_Rtoken_,P,false,false){
}

void Rtoken::sr2(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   T_comment* p2__;
   State* s2__;
   bool abort2__;
   Rule_s_reuse_entry* rule_s_reuse_entry2__;
  };
  SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2);
  
      T_comment* k = sf->p2__;
       k->set_auto_delete(true);
    
}

void Rtoken::sr3(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   T_c_string* p2__;
   State* s2__;
   bool abort2__;
   Rule_s_reuse_entry* rule_s_reuse_entry2__;
  };
  SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2);
  
      ADD_TOKEN_TO_PRODUCER_QUEUE(*sf->p2__);
    
}

void Rtoken::sr4(){
  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);
  
      ADD_TOKEN_TO_PRODUCER_QUEUE(*sf->p1__);
    
}

void Rtoken::sr5(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   Err_bad_eos* p2__;
   State* s2__;
   bool abort2__;
   Rule_s_reuse_entry* rule_s_reuse_entry2__;
  };
  SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2);
  
      ADD_TOKEN_TO_ERROR_QUEUE(*sf->p2__);
      rule_info__.parser__->set_abort_parse(true);
    
}

void Rtoken::sr6(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   T_identifier* p2__;
   State* s2__;
   bool abort2__;
   Rule_s_reuse_entry* rule_s_reuse_entry2__;
  };
  SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2);
  
      ADD_TOKEN_TO_PRODUCER_QUEUE(*sf->p2__);
    
}

void Rtoken::sr7(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   T_int_no* p2__;
   State* s2__;
   bool abort2__;
   Rule_s_reuse_entry* rule_s_reuse_entry2__;
  };
  SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2);
  
      ADD_TOKEN_TO_PRODUCER_QUEUE(*sf->p2__);
    
}

void Rtoken::sr8(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   Err_comment_overrun* p2__;
   State* s2__;
   bool abort2__;
   Rule_s_reuse_entry* rule_s_reuse_entry2__;
  };
  SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2);
  
      ADD_TOKEN_TO_ERROR_QUEUE(*sf->p2__);
      rule_info__.parser__->set_abort_parse(true);
    
}

void Rtoken::sr9(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   Err_bad_esc* p2__;
   State* s2__;
   bool abort2__;
   Rule_s_reuse_entry* rule_s_reuse_entry2__;
  };
  SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2);
  
      ADD_TOKEN_TO_ERROR_QUEUE(*sf->p2__);
      rule_info__.parser__->set_abort_parse(true);
    
}

void Rtoken::sr11(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   Err_bad_char* p2__;
   State* s2__;
   bool abort2__;
   Rule_s_reuse_entry* rule_s_reuse_entry2__;
  };
  SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2);
  
      Err_bad_char* k = sf->p2__;
      ADD_TOKEN_TO_ERROR_QUEUE(*k);
      rule_info__.parser__->set_abort_parse(true);
    
}

void Rtoken::sr12(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   T_in_stbl* p2__;
   State* s2__;
   bool abort2__;
   Rule_s_reuse_entry* rule_s_reuse_entry2__;
  };
  SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2);
  
      ADD_TOKEN_TO_PRODUCER_QUEUE(*sf->p2__);
    
}

void Rtoken::sr13(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   th_in_stbl* p2__;
   State* s2__;
   bool abort2__;
   Rule_s_reuse_entry* rule_s_reuse_entry2__;
  };
  SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2);
  
      ADD_TOKEN_TO_PRODUCER_QUEUE(*sf->p2__);
    
}

void Rtoken::sr14(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   kw_in_stbl* p2__;
   State* s2__;
   bool abort2__;
   Rule_s_reuse_entry* rule_s_reuse_entry2__;
  };
  SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2);
  
      kw_in_stbl* kw = sf->p2__;
      CAbs_lr1_sym* sym = kw->keyword_in_stbl();
      sym->set_rc(*rule_info__.parser__->current_token(),__FILE__,__LINE__);
      ADD_TOKEN_TO_PRODUCER_QUEUE(*sym);
    
}

void Rtoken::sr15(){
  struct SF{
   LR1_parallel_operator* p1__;
   State* s1__;
   bool abort1__;
   Rule_s_reuse_entry* rule_s_reuse_entry1__;
   CAbs_lr1_sym* p2__;
   State* s2__;
   bool abort2__;
   Rule_s_reuse_entry* rule_s_reuse_entry2__;
  };
  SF* sf = (SF*)rule_info__.parser__->parse_stack__.sf_by_top(2);
  
      ADD_TOKEN_TO_PRODUCER_QUEUE(*sf->p2__);
    
}