diff options
Diffstat (limited to 'web/yacco2/compiler/grammars/T_enum_phrase.cpp')
-rw-r--r-- | web/yacco2/compiler/grammars/T_enum_phrase.cpp | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/web/yacco2/compiler/grammars/T_enum_phrase.cpp b/web/yacco2/compiler/grammars/T_enum_phrase.cpp new file mode 100644 index 0000000000..91d9296e00 --- /dev/null +++ b/web/yacco2/compiler/grammars/T_enum_phrase.cpp @@ -0,0 +1,109 @@ +/* + File: T_enum_phrase.cpp + Date and Time: Fri Jan 30 18:55:26 2015 +*/ +#include "T_enum_phrase.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_T_enum_phrase;// grammar's ns +// first set terminals +fsm_rules_reuse_table_type::fsm_rules_reuse_table_type(){ + no_rules_entries_ = 2; + per_rule_s_table_[0] = new Per_rule_s_reuse_table(); + per_rule_s_table_[1] = new Per_rule_s_reuse_table(); +} + CT_enum_phrase:: + CT_enum_phrase() + :yacco2::CAbs_fsm + ("T_enum_phrase.lex" + ,"1.0" + ,"18 mar 2004" + ,false + ,"Dispatcher to parse T-enumeration construct." + ,"Fri Jan 30 18:55:26 2015 " + ,S1_CT_enum_phrase){ + + cweb_marker__ = 0; + + } + +CT_enum_phrase::~CT_enum_phrase(){ + + for(int x = 0;x < 2;++x){ + ///delete fsm_rules_reuse_table.per_rule_s_table_[x]; + } +} + + bool CT_enum_phrase::failed(){ + return false; + } + void CT_enum_phrase::op(){ + if(CWEB_MARKER != 0){ + cweb_marker__ = CWEB_MARKER; + CWEB_MARKER=0; + } + +} +int CT_enum_phrase::rhs_to_rules_mapping_[5] = { + -1 + ,0 // subrule 1 for rule 1 + ,1 // subrule 2 for rule 2 + ,1 // subrule 3 for rule 2 + ,1 // subrule 4 for rule 2 +}; +RT_enum_phrase::RT_enum_phrase(yacco2::Parser* P) + :CAbs_lr1_sym + ("RT_enum_phrase",0,CT_enum_phrase::R_RT_enum_phrase_,P,false,false){ +} + +Rphrase::Rphrase(yacco2::Parser* P) + :CAbs_lr1_sym + ("Rphrase",0,CT_enum_phrase::R_Rphrase_,P,false,false){ +} + +void Rphrase::sr1(){ + struct SF{ + LR1_parallel_operator* p1__; + State* s1__; + bool abort1__; + Rule_s_reuse_entry* rule_s_reuse_entry1__; + T_enum_phrase* 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 Rphrase::sr2(){ + 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_ERROR_QUEUE(*sf->p2__); + +} + +void Rphrase::sr3(){ + + CAbs_lr1_sym* sym = new Err_no_open_parenthesis; + sym->set_rc(*rule_info__.parser__->current_token(),__FILE__,__LINE__); + ADD_TOKEN_TO_ERROR_QUEUE(*sym); + +} + |