/*36:*/ //#line 478 "/usr/local/yacco2/library/intro.w" /*565:*/ //#line 24 "/usr/local/yacco2/library/macros.w" /*:565*/ //#line 479 "/usr/local/yacco2/library/intro.w" /*26:*/ //#line 404 "/usr/local/yacco2/library/intro.w" #include "yacco2.h" /*:26*/ //#line 480 "/usr/local/yacco2/library/intro.w" /*23:*/ //#line 392 "/usr/local/yacco2/library/intro.w" using namespace yacco2; /*:23*/ //#line 481 "/usr/local/yacco2/library/intro.w" /*33:*/ //#line 437 "/usr/local/yacco2/library/intro.w" /*:33*//*60:*/ //#line 137 "/usr/local/yacco2/library/CAbs_lr1_sym.w" yacco2:: CAbs_lr1_sym:: CAbs_lr1_sym( yacco2::KCHARP Id ,yacco2::FN_DTOR Dtor ,yacco2::USINT Enum_id ,yacco2::Parser*P ,bool Auto_delete ,bool Affected_by_abort ) :id__(Id) ,dtor__(Dtor) ,enumerated_id__(Enum_id) ,auto_delete__(Auto_delete) ,affected_by_abort__(Affected_by_abort) {rule_info__.parser__= P; /*50:*/ //#line 120 "/usr/local/yacco2/library/set.w" INT R= Enum_id%SET_ELEM_NO_BITS; tok_co_ords__.set_entry__.partition__= Enum_id/SET_ELEM_NO_BITS; tok_co_ords__.set_entry__.elements__= 1< 0){ tok_co_ords__.external_file_id__= Rc.tok_co_ords__.external_file_id__; tok_co_ords__.rc_pos__= Rc.tok_co_ords__.rc_pos__; tok_co_ords__.line_no__= Rc.tok_co_ords__.line_no__; tok_co_ords__.pos_in_line__= Rc.tok_co_ords__.pos_in_line__; return; } return; } /*:70*//*72:*/ //#line 383 "/usr/local/yacco2/library/CAbs_lr1_sym.w" void yacco2:: CAbs_lr1_sym:: set_rc_pos(yacco2::UINT Pos){ /*546:*/ //#line 49 "/usr/local/yacco2/library/constraints.w" if(Pos<1){ yacco2::KCHARP msg= "Error - Pos not 1 or greater"; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:546*/ //#line 388 "/usr/local/yacco2/library/CAbs_lr1_sym.w" tok_co_ords__.rc_pos__= Pos; } yacco2::UINT yacco2:: CAbs_lr1_sym:: rc_pos(){ return tok_co_ords__.rc_pos__; } /*:72*//*73:*/ //#line 402 "/usr/local/yacco2/library/CAbs_lr1_sym.w" void yacco2:: CAbs_lr1_sym:: set_external_file_id(yacco2::UINT File_no){ /*548:*/ //#line 65 "/usr/local/yacco2/library/constraints.w" if(File_no<1){ yacco2::KCHARP msg= "Error - File_no not 1 or greater"; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:548*/ //#line 407 "/usr/local/yacco2/library/CAbs_lr1_sym.w" tok_co_ords__.external_file_id__= File_no; } yacco2::UINT yacco2:: CAbs_lr1_sym:: external_file_id(){ return tok_co_ords__.external_file_id__; } /*:73*//*74:*/ //#line 420 "/usr/local/yacco2/library/CAbs_lr1_sym.w" void yacco2:: CAbs_lr1_sym:: set_line_no(yacco2::UINT Line_no){ /*545:*/ //#line 41 "/usr/local/yacco2/library/constraints.w" if(Line_no<1){ yacco2::KCHARP msg= "Error - Line_no not 1 or greater"; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:545*/ //#line 425 "/usr/local/yacco2/library/CAbs_lr1_sym.w" tok_co_ords__.line_no__= Line_no; } yacco2::UINT yacco2:: CAbs_lr1_sym:: line_no(){ return tok_co_ords__.line_no__; } yacco2::UINT yacco2:: CAbs_lr1_sym:: pos_in_line(){ return tok_co_ords__.pos_in_line__; } void yacco2:: CAbs_lr1_sym:: set_pos_in_line(yacco2::UINT Pos_in_line){ /*547:*/ //#line 57 "/usr/local/yacco2/library/constraints.w" if(Pos_in_line<1){ yacco2::KCHARP msg= "Error - Pos_in_line not 1 or greater"; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:547*/ //#line 447 "/usr/local/yacco2/library/CAbs_lr1_sym.w" tok_co_ords__.pos_in_line__= Pos_in_line; } void yacco2:: CAbs_lr1_sym:: set_line_no_and_pos_in_line(yacco2::UINT Line_no,yacco2::UINT Pos_in_line){ /*545:*/ //#line 41 "/usr/local/yacco2/library/constraints.w" if(Line_no<1){ yacco2::KCHARP msg= "Error - Line_no not 1 or greater"; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:545*/ //#line 455 "/usr/local/yacco2/library/CAbs_lr1_sym.w" /*547:*/ //#line 57 "/usr/local/yacco2/library/constraints.w" if(Pos_in_line<1){ yacco2::KCHARP msg= "Error - Pos_in_line not 1 or greater"; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:547*/ //#line 456 "/usr/local/yacco2/library/CAbs_lr1_sym.w" tok_co_ords__.line_no__= Line_no; tok_co_ords__.pos_in_line__= Pos_in_line; } void yacco2:: CAbs_lr1_sym:: set_line_no_and_pos_in_line(yacco2::CAbs_lr1_sym&Rc){ tok_co_ords__.line_no__= Rc.tok_co_ords__.line_no__; tok_co_ords__.pos_in_line__= Rc.tok_co_ords__.pos_in_line__; } /*:74*//*75:*/ //#line 473 "/usr/local/yacco2/library/CAbs_lr1_sym.w" void yacco2:: CAbs_lr1_sym:: set_who_created(yacco2::KCHARP File,yacco2::UINT Line_no){ tok_co_ords__.who_file__= File; tok_co_ords__.who_line_no__= Line_no; } yacco2::UINT yacco2:: CAbs_lr1_sym:: who_line_no(){ return tok_co_ords__.who_line_no__; } yacco2::KCHARP yacco2:: CAbs_lr1_sym:: who_file(){ return tok_co_ords__.who_file__; } //#line 1 "/usr/local/yacco2/library/tok_can.w" /*:75*//*120:*/ //#line 81 "/usr/local/yacco2/library/fsm.w" yacco2:: CAbs_fsm:: CAbs_fsm (yacco2::KCHARP Id ,yacco2::KCHARP Version ,yacco2::KCHARP Date ,bool Debug ,yacco2::KCHARP Comments ,yacco2::KCHARP Gened_date ,yacco2::State&Start_state) :id__(Id) ,version__(Version) ,date__(Date) ,gened_date__(Gened_date) ,debug__(Debug) ,comments__(Comments) ,start_state__(&Start_state) ,parser__(0) {} yacco2:: CAbs_fsm:: ~CAbs_fsm(){} /*:120*//*121:*/ //#line 107 "/usr/local/yacco2/library/fsm.w" yacco2::State* yacco2:: CAbs_fsm:: start_state(){ return start_state__; } yacco2::Parser* yacco2:: CAbs_fsm:: parser(){ return parser__; } void yacco2:: CAbs_fsm:: parser(yacco2::Parser&A){ parser__= &A; } yacco2::KCHARP yacco2:: CAbs_fsm:: gened_date(){ return gened_date__; } yacco2::KCHARP yacco2:: CAbs_fsm:: id(){ return id__; } yacco2::KCHARP yacco2:: CAbs_fsm:: version(){ return version__; } yacco2::KCHARP yacco2:: CAbs_fsm:: date(){ return date__; } bool yacco2:: CAbs_fsm:: debug(){ return debug__; } yacco2::KCHARP yacco2:: CAbs_fsm:: comments(){ return comments__; } /*:121*//*122:*/ //#line 180 "/usr/local/yacco2/library/fsm.w" void CAbs_fsm::find_a_recycled_rule (Per_rule_s_reuse_table*Reuse_rule_table ,Rule_s_reuse_entry**Reuse_rule_entry){ reuse_rule_list*rrl(0); if(Reuse_rule_table->for_use_list_!=0){ rrl= Reuse_rule_table->for_use_list_; (*Reuse_rule_entry)= rrl->reuse_rule_entry_; Reuse_rule_table->for_use_list_= rrl->older_; }else{ (*Reuse_rule_entry)= new Rule_s_reuse_entry(); rrl= &(*Reuse_rule_entry)->its_linked_list_; rrl->reuse_rule_entry_= (*Reuse_rule_entry); rrl->per_rule_tbl_ptr_= Reuse_rule_table; } fnd_rrl: rrl->older_= 0; rrl->younger_= 0; if(Reuse_rule_table->in_use_list_!=0){ Reuse_rule_table->in_use_list_->younger_= rrl; rrl->older_= Reuse_rule_table->in_use_list_; Reuse_rule_table->in_use_list_= rrl; }else{ Reuse_rule_table->in_use_list_= rrl; } } void CAbs_fsm::recycle_rule(Rule_s_reuse_entry*Rule_to_recycle){ Per_rule_s_reuse_table*reuse_tbl= Rule_to_recycle->its_linked_list_.per_rule_tbl_ptr_; reuse_rule_list*iul= reuse_tbl->in_use_list_; reuse_rule_list*ful= reuse_tbl->for_use_list_; reuse_rule_list*rrl= &Rule_to_recycle->its_linked_list_; reuse_rule_list*older_rrl= rrl->older_; reuse_rule_list*younger_rrl= rrl->younger_; rrl->younger_= 0; rrl->older_= reuse_tbl->for_use_list_; reuse_tbl->for_use_list_= rrl; if(rrl==iul){ reuse_tbl->in_use_list_= older_rrl; if(older_rrl!=0){ older_rrl->younger_= 0; } return; } if(older_rrl==0){ younger_rrl->older_= 0; return; } younger_rrl->older_= older_rrl; older_rrl->younger_= younger_rrl; } //#line 1 "/usr/local/yacco2/library/parse_env.w" /*:122*//*126:*/ //#line 113 "/usr/local/yacco2/library/parse_env.w" lr_stk::lr_stk(){ top_sub__= 1; first_sf__= &lr_stk__[1]; top__= first_sf__; first_state__= 0; top__->state__= 0; top__->symbol__= 0; top__->aborted__= 0; top__->rule_s_reuse_entry_ptr__= 0; } void lr_stk::lr_stk_init(yacco2::State&S1){ top_sub__= 1; first_sf__= &lr_stk__[1]; top__= first_sf__; first_state__= &S1; top__->state__= first_state__; top__->symbol__= 0; top__->aborted__= 0; top__->rule_s_reuse_entry_ptr__= 0; } bool lr_stk::empty(){ if(top_sub__<1)return true; return false; } void lr_stk::push_symbol(yacco2::CAbs_lr1_sym&Sym){ top__->symbol__= &Sym; } void lr_stk::pop(){ --top_sub__; --top__; } void lr_stk::clean_up(){ top_sub__= 1; first_sf__= &lr_stk__[1]; top__= first_sf__; top__->symbol__= 0; top__->aborted__= 0; top__->state__= first_state__; top__->rule_s_reuse_entry_ptr__= 0; } /*:126*//*130:*/ //#line 181 "/usr/local/yacco2/library/parse_env.w" Cparse_record*lr_stk::sf_by_sub(yacco2::UINT Sub){ if((Sub<1)||(Sub> MAX_LR_STK_ITEMS)){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "lr_stk - sf_by_sub invalid sub: %i not in range 1..%i"; sprintf(a,msg,Sub,MAX_LR_STK_ITEMS); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } return&lr_stk__[Sub]; } Cparse_record*lr_stk::sf_by_top(yacco2::UINT No){ int s= top_sub__-No; if(s<1){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "lr_stk - sf_by_top underflow top sub: %i, requested sub: %i < 1"; sprintf(a,msg,top_sub__,No); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } return&lr_stk__[s]; } /*:130*//*131:*/ //#line 208 "/usr/local/yacco2/library/parse_env.w" void lr_stk::push_state(yacco2::State&S1){ if(top_sub__>=MAX_LR_STK_ITEMS){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "lr_stk - push overflow stack max: %i"; sprintf(a,msg,MAX_LR_STK_ITEMS); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } ++top__; ++top_sub__; top__->state__= &S1; top__->symbol__= 0; top__->aborted__= 0; top__->rule_s_reuse_entry_ptr__= 0; } /*:131*//*133:*/ //#line 247 "/usr/local/yacco2/library/parse_env.w" void yacco2:: Cparse_record:: set_aborted(bool X){ aborted__= X; } bool yacco2:: Cparse_record:: aborted()const{ if(aborted__==0)return false; return true; } /*:133*//*134:*/ //#line 265 "/usr/local/yacco2/library/parse_env.w" void yacco2:: Cparse_record:: set_rule_s_reuse_entry(yacco2::Rule_s_reuse_entry*Rule_s_reuse){ rule_s_reuse_entry_ptr__= Rule_s_reuse; } yacco2::Rule_s_reuse_entry* yacco2:: Cparse_record:: rule_s_reuse_entry(){ return rule_s_reuse_entry_ptr__; } /*:134*//*135:*/ //#line 282 "/usr/local/yacco2/library/parse_env.w" void yacco2:: Cparse_record:: set_state(yacco2::State*State_ptr){ state__= State_ptr; } yacco2:: State* yacco2:: Cparse_record:: state(){ return state__; } /*:135*//*136:*/ //#line 299 "/usr/local/yacco2/library/parse_env.w" yacco2::CAbs_lr1_sym* yacco2:: Cparse_record:: symbol(){ return symbol__; } void yacco2:: Cparse_record:: set_symbol(yacco2::CAbs_lr1_sym*Symbol){ symbol__= Symbol; } //#line 1 "/usr/local/yacco2/library/wthread.w" /*:136*//*230:*/ //#line 217 "/usr/local/yacco2/library/parser.w" yacco2:: Parser:: Parser (yacco2::CAbs_fsm&Fsm_tbl ,yacco2::token_container_type*Token_supplier ,yacco2::token_container_type*Token_producer ,yacco2::UINT Token_supplier_key_pos ,yacco2::token_container_type*Error_queue ,yacco2::token_container_type*Recycle_bin ,yacco2::tble_lkup_type*Sym_lookup_functor ,bool Use_all_shift) :fsm_tbl__(&Fsm_tbl) ,thread_name__(Fsm_tbl.id__) ,thread_entry__(0) ,token_supplier__(Token_supplier) ,token_producer__(Token_producer) ,error_queue__(Error_queue) ,recycle_bin__(Recycle_bin) ,current_token__(0) ,current_token_pos__(Token_supplier_key_pos) ,start_token__(0) ,start_token_pos__(Token_supplier_key_pos) ,sym_lookup_functor__(Sym_lookup_functor) ,abort_parse__(OFF) ,stop_parse__(OFF) ,use_all_shift__(Use_all_shift) ,has_questionable_shift_occured__(OFF) ,from_thread__(0) ,thread_no__(THREAD_SELF()) ,cv_cond__(WAIT_FOR_EVENT) ,th_blk__() ,pp_accept_queue_idx__(0) ,pp_accept_queue__() ,th_active_cnt__(0) ,th_accepting_cnt__(0) ,pp_requesting_parallelism__(0) ,msg_id__(0) ,arbitrated_token__(0) ,no_competing_pp_ths__(0) ,no_requested_ths_to_run__(0) ,th_lst__() ,launched_as_procedure__(false) ,supplier_r_w_cnt__(1) { CREATE_COND_VAR(cv__); CREATE_MUTEX(mu__); LOCK_MUTEX_OF_CALLED_PARSER(mu__,*this," of self"); parse_stack__.lr_stk_init(*Fsm_tbl.start_state__); for(int x= 0;xr_w_cnt__; } fsm_tbl__->parser(*this); Fsm_tbl.parser(*this); if(Token_supplier!=0){ current_token__= get_spec_token(current_token_pos__); }else{ current_token__= yacco2::PTR_LR1_eog__; } start_token__= current_token__; /*231:*/ //#line 308 "/usr/local/yacco2/library/parser.w" if(current_token__==0)return; /*:231*/ //#line 281 "/usr/local/yacco2/library/parser.w" parse_stack__.lr_stk_init(*fsm_tbl__->start_state__); if(YACCO2_T__!=0){ if(current_token__==0)return; /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<enumerated_id__ <<' '<<'"'<id__<<'"' <<" pos: "<tok_co_ords__.line_no__ <<" GPS CHR POS: " <tok_co_ords__.pos_in_line__ <parser(*this); Fsm_tbl.parser(*this); parse_stack__.lr_stk_init(*fsm_tbl__->start_state__); for(int x= 0;xparser(*this); Fsm_tbl.parser(*this); parse_stack__.lr_stk_init(*fsm_tbl__->start_state__); for(int x= 0;xsymbol__= current_token__; /*:242*/ //#line 456 "/usr/local/yacco2/library/parser.w" yacco2::State*Goto_state= SE.goto__; /*349:*/ //#line 2379 "/usr/local/yacco2/library/parser.w" /*132:*/ //#line 226 "/usr/local/yacco2/library/parse_env.w" if(parse_stack__.top_sub__>=MAX_LR_STK_ITEMS){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "lr_stk - push overflow stack max: %i"; sprintf(a,msg,MAX_LR_STK_ITEMS); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } ++parse_stack__.top__; ++parse_stack__.top_sub__; parse_stack__.top__->state__= Goto_state; parse_stack__.top__->symbol__= 0; parse_stack__.top__->aborted__= 0; parse_stack__.top__->rule_s_reuse_entry_ptr__= 0; /*:132*/ //#line 2380 "/usr/local/yacco2/library/parser.w" /*:349*/ //#line 458 "/usr/local/yacco2/library/parser.w" /*581:*/ //#line 373 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); } /*:581*/ //#line 459 "/usr/local/yacco2/library/parser.w" get_next_token(); } /*:236*//*238:*/ //#line 472 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: invisible_shift(yacco2::Shift_entry&SE){ /*352:*/ //#line 2415 "/usr/local/yacco2/library/parser.w" Cparse_record*pr= parse_stack__.top__; /*:352*/ //#line 477 "/usr/local/yacco2/library/parser.w" /*239:*/ //#line 484 "/usr/local/yacco2/library/parser.w" pr->symbol__= NS_yacco2_k_symbols::PTR_LR1_invisible_shift_operator__; /*:239*/ //#line 478 "/usr/local/yacco2/library/parser.w" yacco2::State*Goto_state= SE.goto__; /*349:*/ //#line 2379 "/usr/local/yacco2/library/parser.w" /*132:*/ //#line 226 "/usr/local/yacco2/library/parse_env.w" if(parse_stack__.top_sub__>=MAX_LR_STK_ITEMS){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "lr_stk - push overflow stack max: %i"; sprintf(a,msg,MAX_LR_STK_ITEMS); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } ++parse_stack__.top__; ++parse_stack__.top_sub__; parse_stack__.top__->state__= Goto_state; parse_stack__.top__->symbol__= 0; parse_stack__.top__->aborted__= 0; parse_stack__.top__->rule_s_reuse_entry_ptr__= 0; /*:132*/ //#line 2380 "/usr/local/yacco2/library/parser.w" /*:349*/ //#line 480 "/usr/local/yacco2/library/parser.w" /*581:*/ //#line 373 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); } /*:581*/ //#line 481 "/usr/local/yacco2/library/parser.w" } /*:238*//*240:*/ //#line 494 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: questionable_shift(yacco2::Shift_entry&SE){ has_questionable_shift_occured__= ON; /*352:*/ //#line 2415 "/usr/local/yacco2/library/parser.w" Cparse_record*pr= parse_stack__.top__; /*:352*/ //#line 500 "/usr/local/yacco2/library/parser.w" /*242:*/ //#line 524 "/usr/local/yacco2/library/parser.w" pr->symbol__= current_token__; /*:242*/ //#line 501 "/usr/local/yacco2/library/parser.w" yacco2::State*Goto_state= SE.goto__; /*349:*/ //#line 2379 "/usr/local/yacco2/library/parser.w" /*132:*/ //#line 226 "/usr/local/yacco2/library/parse_env.w" if(parse_stack__.top_sub__>=MAX_LR_STK_ITEMS){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "lr_stk - push overflow stack max: %i"; sprintf(a,msg,MAX_LR_STK_ITEMS); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } ++parse_stack__.top__; ++parse_stack__.top_sub__; parse_stack__.top__->state__= Goto_state; parse_stack__.top__->symbol__= 0; parse_stack__.top__->aborted__= 0; parse_stack__.top__->rule_s_reuse_entry_ptr__= 0; /*:132*/ //#line 2380 "/usr/local/yacco2/library/parser.w" /*:349*/ //#line 503 "/usr/local/yacco2/library/parser.w" /*581:*/ //#line 373 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); } /*:581*/ //#line 504 "/usr/local/yacco2/library/parser.w" } /*:240*//*241:*/ //#line 510 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: all_shift(yacco2::Shift_entry&SE){ /*352:*/ //#line 2415 "/usr/local/yacco2/library/parser.w" Cparse_record*pr= parse_stack__.top__; /*:352*/ //#line 515 "/usr/local/yacco2/library/parser.w" /*242:*/ //#line 524 "/usr/local/yacco2/library/parser.w" pr->symbol__= current_token__; /*:242*/ //#line 516 "/usr/local/yacco2/library/parser.w" yacco2::State*Goto_state= SE.goto__; /*349:*/ //#line 2379 "/usr/local/yacco2/library/parser.w" /*132:*/ //#line 226 "/usr/local/yacco2/library/parse_env.w" if(parse_stack__.top_sub__>=MAX_LR_STK_ITEMS){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "lr_stk - push overflow stack max: %i"; sprintf(a,msg,MAX_LR_STK_ITEMS); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } ++parse_stack__.top__; ++parse_stack__.top_sub__; parse_stack__.top__->state__= Goto_state; parse_stack__.top__->symbol__= 0; parse_stack__.top__->aborted__= 0; parse_stack__.top__->rule_s_reuse_entry_ptr__= 0; /*:132*/ //#line 2380 "/usr/local/yacco2/library/parser.w" /*:349*/ //#line 518 "/usr/local/yacco2/library/parser.w" /*581:*/ //#line 373 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); } /*:581*/ //#line 519 "/usr/local/yacco2/library/parser.w" get_next_token(); } /*:241*//*243:*/ //#line 529 "/usr/local/yacco2/library/parser.w" yacco2:: Parser::parse_result yacco2:: Parser:: reduce(yacco2::Reduce_entry&RE){ /*244:*/ //#line 554 "/usr/local/yacco2/library/parser.w" Rule_s_reuse_entry*rule_rec1(0); Rule_s_reuse_entry**rule_rec= &rule_rec1; fsm_tbl__->reduce_rhs_of_rule(RE.rhs_id__,rule_rec); /*:244*/ //#line 535 "/usr/local/yacco2/library/parser.w" /*246:*/ //#line 569 "/usr/local/yacco2/library/parser.w" remove_from_stack((*rule_rec)->rule_->rule_info__.rhs_no_of_parms__); /*:246*/ //#line 536 "/usr/local/yacco2/library/parser.w" /*247:*/ //#line 572 "/usr/local/yacco2/library/parser.w" parse_stack__.top__->set_symbol((*rule_rec)->rule_); parse_stack__.top__->set_rule_s_reuse_entry(*rule_rec); /*:247*/ //#line 537 "/usr/local/yacco2/library/parser.w" /*248:*/ //#line 577 "/usr/local/yacco2/library/parser.w" Shift_entry*se(0); if(parse_stack__.top__->state__->shift_tbl_ptr__!=0) se= find_R_or_paralleled_T_shift_entry((*rule_rec)->rule_->enumerated_id__); /*:248*/ //#line 538 "/usr/local/yacco2/library/parser.w" /*559:*/ //#line 206 "/usr/local/yacco2/library/constraints.w" if(se==0){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "Error - Cant find rule shift in state FSM id: %s state: %i rule id: %i "; sprintf(a,msg,fsm_tbl__->id__,parse_stack__.top__->state__->state_no__ ,(*rule_rec)->rule_->enumerated_id__); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } /*:559*/ //#line 539 "/usr/local/yacco2/library/parser.w" /*245:*/ //#line 560 "/usr/local/yacco2/library/parser.w" yacco2::State*Goto_state= se->goto__; /*349:*/ //#line 2379 "/usr/local/yacco2/library/parser.w" /*132:*/ //#line 226 "/usr/local/yacco2/library/parse_env.w" if(parse_stack__.top_sub__>=MAX_LR_STK_ITEMS){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "lr_stk - push overflow stack max: %i"; sprintf(a,msg,MAX_LR_STK_ITEMS); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } ++parse_stack__.top__; ++parse_stack__.top_sub__; parse_stack__.top__->state__= Goto_state; parse_stack__.top__->symbol__= 0; parse_stack__.top__->aborted__= 0; parse_stack__.top__->rule_s_reuse_entry_ptr__= 0; /*:132*/ //#line 2380 "/usr/local/yacco2/library/parser.w" /*:349*/ //#line 562 "/usr/local/yacco2/library/parser.w" /*581:*/ //#line 373 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); } /*:581*/ //#line 563 "/usr/local/yacco2/library/parser.w" if(se->goto__->state_no__==1) return Parser::accepted; return Parser::reduced; /*:245*/ //#line 540 "/usr/local/yacco2/library/parser.w" } /*:243*//*249:*/ //#line 598 "/usr/local/yacco2/library/parser.w" yacco2:: Parser::parse_result yacco2:: Parser:: parse(){ /*250:*/ //#line 622 "/usr/local/yacco2/library/parser.w" if(current_token__==0) return Parser::accepted; /*:250*/ //#line 604 "/usr/local/yacco2/library/parser.w" /*252:*/ //#line 661 "/usr/local/yacco2/library/parser.w" fsm_tbl__->op(); /*:252*/ //#line 605 "/usr/local/yacco2/library/parser.w" parse_result result; read_token_stream: { /*251:*/ //#line 627 "/usr/local/yacco2/library/parser.w" /*352:*/ //#line 2415 "/usr/local/yacco2/library/parser.w" Cparse_record*pr= parse_stack__.top__; /*:352*/ //#line 628 "/usr/local/yacco2/library/parser.w" if(stop_parse__==ON){ cleanup_stack_due_to_abort(); goto parse_successful; } if(abort_parse__==ON)goto parse_unsuccessful; State*cur_state= pr->state__; /*254:*/ //#line 711 "/usr/local/yacco2/library/parser.w" /*544:*/ //#line 32 "/usr/local/yacco2/library/constraints.w" if(current_token__==0){ yacco2::KCHARP msg= "Error - current token ptr zero. Cannot continue parsing."; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:544*/ //#line 712 "/usr/local/yacco2/library/parser.w" if(cur_state->parallel_shift__!=0)goto parallel_parsing; if(cur_state->proc_call_shift__!=0)goto proc_call_parsing; else goto straight_parsing; /*:254*/ //#line 635 "/usr/local/yacco2/library/parser.w" parallel_parsing: /*255:*/ //#line 721 "/usr/local/yacco2/library/parser.w" result= start_parallel_parsing(*cur_state); if(result==no_thds_to_run)goto straight_parsing; /*:255*/ //#line 637 "/usr/local/yacco2/library/parser.w" /*256:*/ //#line 730 "/usr/local/yacco2/library/parser.w" if(result==paralleled){ if(parse_stack__.top__->state__->proc_call_shift__!=0){ cur_state= parse_stack__.top__->state__; goto proc_call_parsing; } /*257:*/ //#line 742 "/usr/local/yacco2/library/parser.w" Reduce_entry*re(0); if(parse_stack__.top__->state__->reduce_tbl_ptr__!=0) re= find_parallel_reduce_entry(); /*:257*/ //#line 736 "/usr/local/yacco2/library/parser.w" /*560:*/ //#line 219 "/usr/local/yacco2/library/constraints.w" if(re==0){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "Error - Cant find parallel sym reduce in FSM id: %s state: %i token: %s subs: %i "; sprintf(a,msg,fsm_tbl__->id__,pr->state__->state_no__ ,current_token__->id__,current_token_pos__); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } /*:560*/ //#line 737 "/usr/local/yacco2/library/parser.w" /*353:*/ //#line 2419 "/usr/local/yacco2/library/parser.w" pr= parse_stack__.top__; /*:353*/ //#line 738 "/usr/local/yacco2/library/parser.w" /*264:*/ //#line 801 "/usr/local/yacco2/library/parser.w" if(re!=0){ result= reduce(*re); if(stop_parse__==ON){ cleanup_stack_due_to_abort(); goto parse_successful; } if(abort_parse__==ON)goto parse_unsuccessful; if(result==Parser::reduced)goto read_token_stream; if(result==Parser::accepted)goto parse_successful; } /*:264*/ //#line 739 "/usr/local/yacco2/library/parser.w" } /*:256*/ //#line 638 "/usr/local/yacco2/library/parser.w" /*258:*/ //#line 749 "/usr/local/yacco2/library/parser.w" /*588:*/ //#line 482 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__ <<"::############# TRY STRAIGHT try_straight_due_to_aborted_parallel" <<" reset token pos: "<id__ <tok_co_ords__.line_no__ <<" GPS RESET CHR POS: " <tok_co_ords__.pos_in_line__ <state__->reduce_tbl_ptr__!=0) re= find_proc_call_reduce_entry(); /*:261*/ //#line 773 "/usr/local/yacco2/library/parser.w" /*560:*/ //#line 219 "/usr/local/yacco2/library/constraints.w" if(re==0){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "Error - Cant find parallel sym reduce in FSM id: %s state: %i token: %s subs: %i "; sprintf(a,msg,fsm_tbl__->id__,pr->state__->state_no__ ,current_token__->id__,current_token_pos__); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } /*:560*/ //#line 774 "/usr/local/yacco2/library/parser.w" /*353:*/ //#line 2419 "/usr/local/yacco2/library/parser.w" pr= parse_stack__.top__; /*:353*/ //#line 775 "/usr/local/yacco2/library/parser.w" /*264:*/ //#line 801 "/usr/local/yacco2/library/parser.w" if(re!=0){ result= reduce(*re); if(stop_parse__==ON){ cleanup_stack_due_to_abort(); goto parse_successful; } if(abort_parse__==ON)goto parse_unsuccessful; if(result==Parser::reduced)goto read_token_stream; if(result==Parser::accepted)goto parse_successful; } /*:264*/ //#line 776 "/usr/local/yacco2/library/parser.w" } /*:260*/ //#line 643 "/usr/local/yacco2/library/parser.w" /*262:*/ //#line 786 "/usr/local/yacco2/library/parser.w" /*589:*/ //#line 507 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__ <<"::############# TRY STRAIGHT try_straight_due_to_aborted_parallel" <<" reset token pos: " <id__ <tok_co_ords__.line_no__ <<" GPS RESET CHR POS: " <tok_co_ords__.pos_in_line__ <state__->shift_tbl_ptr__!=0) se= find_cur_T_shift_entry(); /*:237*/ //#line 647 "/usr/local/yacco2/library/parser.w" /*253:*/ //#line 678 "/usr/local/yacco2/library/parser.w" if(se!=0){ shift(*se); goto read_token_stream; } if(cur_state->questionable_shift__!=0){ if(has_questionable_shift_occured__==ON){ /*543:*/ //#line 21 "/usr/local/yacco2/library/constraints.w" char a[BUFFER_SIZE]; yacco2::KCHARP msg= "Error - Bad use of |?| instead of |+| symbol or epsilon subrule. " "Correct %s grammar, parse state: %i. Cannot continue parsing."; sprintf(a,msg,fsm_tbl__->id__,parse_stack__.top__->state__->state_no__); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); /*:543*/ //#line 686 "/usr/local/yacco2/library/parser.w" } questionable_shift(*cur_state->questionable_shift__); goto read_token_stream; } if(cur_state->inv_shift__){ invisible_shift(*cur_state->inv_shift__); goto read_token_stream; } if(use_all_shift__==ON){ if(cur_state->all_shift__==0){ }else{ if(current_token__->enumerated_id__==LR1_Eog) { use_all_shift__= OFF; all_shift(*cur_state->all_shift__); }else{ all_shift(*cur_state->all_shift__); goto read_token_stream; } } } /*:253*/ //#line 648 "/usr/local/yacco2/library/parser.w" /*263:*/ //#line 793 "/usr/local/yacco2/library/parser.w" Reduce_entry*re(0); if(parse_stack__.top__->state__->reduce_tbl_ptr__!=0) re= find_reduce_entry(); /*:263*/ //#line 649 "/usr/local/yacco2/library/parser.w" /*264:*/ //#line 801 "/usr/local/yacco2/library/parser.w" if(re!=0){ result= reduce(*re); if(stop_parse__==ON){ cleanup_stack_due_to_abort(); goto parse_successful; } if(abort_parse__==ON)goto parse_unsuccessful; if(result==Parser::reduced)goto read_token_stream; if(result==Parser::accepted)goto parse_successful; } /*:264*/ //#line 650 "/usr/local/yacco2/library/parser.w" goto parse_unsuccessful; /*:251*/ //#line 610 "/usr/local/yacco2/library/parser.w" } parse_successful: return Parser::accepted; parse_unsuccessful: fsm_tbl__->failed(); /*590:*/ //#line 535 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::"; yacco2::lrclog<<"#############straight parse-error current token " <<'"'<id__ <<'"'<<" pos: "<tok_co_ords__.line_no__ <<" GPS RESET CHR POS: " <tok_co_ords__.pos_in_line__ <state__->shift_tbl_ptr__!=0) se= find_R_or_paralleled_T_shift_entry(Accept_terminal.enumerated_id__); if(se!=0)goto set_stack_to_symbol_being_shifted; se= pr->state__->questionable_shift__; if(se!=0)goto set_stack_to_symbol_being_shifted; se= pr->state__->all_shift__; if(se!=0)goto set_stack_to_symbol_being_shifted; /*558:*/ //#line 184 "/usr/local/yacco2/library/constraints.w" if(se==0){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "Error - Can't find symbol to shift in FSM id: %s state: %i sym-id: %i literal: %s"; CAbs_lr1_sym*xxx= current_token(); sprintf(a,msg,fsm_tbl__->id__,pr->state__->state_no__,xxx->enumerated_id(),xxx->id()); Yacco2_faulty_precondition(a,__FILE__,__LINE__); yacco2::KCHARP msg2= "T co-ordinates: file: %s GPS LINE: %i GPS CHR POS: %i"; sprintf(a,msg2 ,xxx->tok_co_ords__.external_file_id__!=MAX_USINT? yacco2::FILE_TBL__[xxx->tok_co_ords__.external_file_id__].c_str() :" No external file" ,xxx->tok_co_ords__.line_no__ ,xxx->tok_co_ords__.pos_in_line__); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } /*:558*/ //#line 858 "/usr/local/yacco2/library/parser.w" set_stack_to_symbol_being_shifted: /*266:*/ //#line 864 "/usr/local/yacco2/library/parser.w" pr->symbol__= &Accept_terminal; yacco2::State*Goto_state= se->goto__; /*349:*/ //#line 2379 "/usr/local/yacco2/library/parser.w" /*132:*/ //#line 226 "/usr/local/yacco2/library/parse_env.w" if(parse_stack__.top_sub__>=MAX_LR_STK_ITEMS){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "lr_stk - push overflow stack max: %i"; sprintf(a,msg,MAX_LR_STK_ITEMS); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } ++parse_stack__.top__; ++parse_stack__.top_sub__; parse_stack__.top__->state__= Goto_state; parse_stack__.top__->symbol__= 0; parse_stack__.top__->aborted__= 0; parse_stack__.top__->rule_s_reuse_entry_ptr__= 0; /*:132*/ //#line 2380 "/usr/local/yacco2/library/parser.w" /*:349*/ //#line 867 "/usr/local/yacco2/library/parser.w" /*:266*/ //#line 860 "/usr/local/yacco2/library/parser.w" } /*:265*//*267:*/ //#line 892 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: proc_call_shift(yacco2::CAbs_lr1_sym&Accept_terminal){ /*352:*/ //#line 2415 "/usr/local/yacco2/library/parser.w" Cparse_record*pr= parse_stack__.top__; /*:352*/ //#line 897 "/usr/local/yacco2/library/parser.w" Shift_entry*se(0); if(pr->state__->shift_tbl_ptr__!=0) se= find_R_or_paralleled_T_shift_entry(Accept_terminal.enumerated_id__); if(se!=0)goto set_stack_to_symbol_being_shifted; se= pr->state__->all_shift__; if(se!=0)goto set_stack_to_symbol_being_shifted; se= pr->state__->questionable_shift__; if(se!=0)goto set_stack_to_symbol_being_shifted; /*558:*/ //#line 184 "/usr/local/yacco2/library/constraints.w" if(se==0){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "Error - Can't find symbol to shift in FSM id: %s state: %i sym-id: %i literal: %s"; CAbs_lr1_sym*xxx= current_token(); sprintf(a,msg,fsm_tbl__->id__,pr->state__->state_no__,xxx->enumerated_id(),xxx->id()); Yacco2_faulty_precondition(a,__FILE__,__LINE__); yacco2::KCHARP msg2= "T co-ordinates: file: %s GPS LINE: %i GPS CHR POS: %i"; sprintf(a,msg2 ,xxx->tok_co_ords__.external_file_id__!=MAX_USINT? yacco2::FILE_TBL__[xxx->tok_co_ords__.external_file_id__].c_str() :" No external file" ,xxx->tok_co_ords__.line_no__ ,xxx->tok_co_ords__.pos_in_line__); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } /*:558*/ //#line 906 "/usr/local/yacco2/library/parser.w" set_stack_to_symbol_being_shifted: /*268:*/ //#line 912 "/usr/local/yacco2/library/parser.w" pr->symbol__= &Accept_terminal; yacco2::State*Goto_state= se->goto__; /*349:*/ //#line 2379 "/usr/local/yacco2/library/parser.w" /*132:*/ //#line 226 "/usr/local/yacco2/library/parse_env.w" if(parse_stack__.top_sub__>=MAX_LR_STK_ITEMS){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "lr_stk - push overflow stack max: %i"; sprintf(a,msg,MAX_LR_STK_ITEMS); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } ++parse_stack__.top__; ++parse_stack__.top_sub__; parse_stack__.top__->state__= Goto_state; parse_stack__.top__->symbol__= 0; parse_stack__.top__->aborted__= 0; parse_stack__.top__->rule_s_reuse_entry_ptr__= 0; /*:132*/ //#line 2380 "/usr/local/yacco2/library/parser.w" /*:349*/ //#line 915 "/usr/local/yacco2/library/parser.w" /*:268*/ //#line 908 "/usr/local/yacco2/library/parser.w" } /*:267*//*269:*/ //#line 921 "/usr/local/yacco2/library/parser.w" yacco2:: Parser::parse_result yacco2:: Parser:: parallel_parse(){ /*252:*/ //#line 661 "/usr/local/yacco2/library/parser.w" fsm_tbl__->op(); /*:252*/ //#line 927 "/usr/local/yacco2/library/parser.w" parse_result result; /*270:*/ //#line 941 "/usr/local/yacco2/library/parser.w" if(current_token__==0)goto parse_unsuccessful; goto read_token_stream; /*:270*/ //#line 929 "/usr/local/yacco2/library/parser.w" read_token_stream:{ /*271:*/ //#line 946 "/usr/local/yacco2/library/parser.w" /*352:*/ //#line 2415 "/usr/local/yacco2/library/parser.w" Cparse_record*pr= parse_stack__.top__; /*:352*/ //#line 947 "/usr/local/yacco2/library/parser.w" if(stop_parse__==ON){ cleanup_stack_due_to_abort(); goto parse_successful; } if(abort_parse__==ON)goto parse_unsuccessful; State*cur_state= pr->state__; /*254:*/ //#line 711 "/usr/local/yacco2/library/parser.w" /*544:*/ //#line 32 "/usr/local/yacco2/library/constraints.w" if(current_token__==0){ yacco2::KCHARP msg= "Error - current token ptr zero. Cannot continue parsing."; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:544*/ //#line 712 "/usr/local/yacco2/library/parser.w" if(cur_state->parallel_shift__!=0)goto parallel_parsing; if(cur_state->proc_call_shift__!=0)goto proc_call_parsing; else goto straight_parsing; /*:254*/ //#line 955 "/usr/local/yacco2/library/parser.w" parallel_parsing: /*255:*/ //#line 721 "/usr/local/yacco2/library/parser.w" result= start_parallel_parsing(*cur_state); if(result==no_thds_to_run)goto straight_parsing; /*:255*/ //#line 957 "/usr/local/yacco2/library/parser.w" /*256:*/ //#line 730 "/usr/local/yacco2/library/parser.w" if(result==paralleled){ if(parse_stack__.top__->state__->proc_call_shift__!=0){ cur_state= parse_stack__.top__->state__; goto proc_call_parsing; } /*257:*/ //#line 742 "/usr/local/yacco2/library/parser.w" Reduce_entry*re(0); if(parse_stack__.top__->state__->reduce_tbl_ptr__!=0) re= find_parallel_reduce_entry(); /*:257*/ //#line 736 "/usr/local/yacco2/library/parser.w" /*560:*/ //#line 219 "/usr/local/yacco2/library/constraints.w" if(re==0){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "Error - Cant find parallel sym reduce in FSM id: %s state: %i token: %s subs: %i "; sprintf(a,msg,fsm_tbl__->id__,pr->state__->state_no__ ,current_token__->id__,current_token_pos__); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } /*:560*/ //#line 737 "/usr/local/yacco2/library/parser.w" /*353:*/ //#line 2419 "/usr/local/yacco2/library/parser.w" pr= parse_stack__.top__; /*:353*/ //#line 738 "/usr/local/yacco2/library/parser.w" /*264:*/ //#line 801 "/usr/local/yacco2/library/parser.w" if(re!=0){ result= reduce(*re); if(stop_parse__==ON){ cleanup_stack_due_to_abort(); goto parse_successful; } if(abort_parse__==ON)goto parse_unsuccessful; if(result==Parser::reduced)goto read_token_stream; if(result==Parser::accepted)goto parse_successful; } /*:264*/ //#line 739 "/usr/local/yacco2/library/parser.w" } /*:256*/ //#line 958 "/usr/local/yacco2/library/parser.w" /*258:*/ //#line 749 "/usr/local/yacco2/library/parser.w" /*588:*/ //#line 482 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__ <<"::############# TRY STRAIGHT try_straight_due_to_aborted_parallel" <<" reset token pos: "<id__ <tok_co_ords__.line_no__ <<" GPS RESET CHR POS: " <tok_co_ords__.pos_in_line__ <state__->reduce_tbl_ptr__!=0) re= find_proc_call_reduce_entry(); /*:261*/ //#line 773 "/usr/local/yacco2/library/parser.w" /*560:*/ //#line 219 "/usr/local/yacco2/library/constraints.w" if(re==0){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "Error - Cant find parallel sym reduce in FSM id: %s state: %i token: %s subs: %i "; sprintf(a,msg,fsm_tbl__->id__,pr->state__->state_no__ ,current_token__->id__,current_token_pos__); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } /*:560*/ //#line 774 "/usr/local/yacco2/library/parser.w" /*353:*/ //#line 2419 "/usr/local/yacco2/library/parser.w" pr= parse_stack__.top__; /*:353*/ //#line 775 "/usr/local/yacco2/library/parser.w" /*264:*/ //#line 801 "/usr/local/yacco2/library/parser.w" if(re!=0){ result= reduce(*re); if(stop_parse__==ON){ cleanup_stack_due_to_abort(); goto parse_successful; } if(abort_parse__==ON)goto parse_unsuccessful; if(result==Parser::reduced)goto read_token_stream; if(result==Parser::accepted)goto parse_successful; } /*:264*/ //#line 776 "/usr/local/yacco2/library/parser.w" } /*:260*/ //#line 963 "/usr/local/yacco2/library/parser.w" /*262:*/ //#line 786 "/usr/local/yacco2/library/parser.w" /*589:*/ //#line 507 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__ <<"::############# TRY STRAIGHT try_straight_due_to_aborted_parallel" <<" reset token pos: " <id__ <tok_co_ords__.line_no__ <<" GPS RESET CHR POS: " <tok_co_ords__.pos_in_line__ <state__->shift_tbl_ptr__!=0) se= find_cur_T_shift_entry(); /*:237*/ //#line 968 "/usr/local/yacco2/library/parser.w" /*253:*/ //#line 678 "/usr/local/yacco2/library/parser.w" if(se!=0){ shift(*se); goto read_token_stream; } if(cur_state->questionable_shift__!=0){ if(has_questionable_shift_occured__==ON){ /*543:*/ //#line 21 "/usr/local/yacco2/library/constraints.w" char a[BUFFER_SIZE]; yacco2::KCHARP msg= "Error - Bad use of |?| instead of |+| symbol or epsilon subrule. " "Correct %s grammar, parse state: %i. Cannot continue parsing."; sprintf(a,msg,fsm_tbl__->id__,parse_stack__.top__->state__->state_no__); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); /*:543*/ //#line 686 "/usr/local/yacco2/library/parser.w" } questionable_shift(*cur_state->questionable_shift__); goto read_token_stream; } if(cur_state->inv_shift__){ invisible_shift(*cur_state->inv_shift__); goto read_token_stream; } if(use_all_shift__==ON){ if(cur_state->all_shift__==0){ }else{ if(current_token__->enumerated_id__==LR1_Eog) { use_all_shift__= OFF; all_shift(*cur_state->all_shift__); }else{ all_shift(*cur_state->all_shift__); goto read_token_stream; } } } /*:253*/ //#line 969 "/usr/local/yacco2/library/parser.w" /*263:*/ //#line 793 "/usr/local/yacco2/library/parser.w" Reduce_entry*re(0); if(parse_stack__.top__->state__->reduce_tbl_ptr__!=0) re= find_reduce_entry(); /*:263*/ //#line 970 "/usr/local/yacco2/library/parser.w" /*264:*/ //#line 801 "/usr/local/yacco2/library/parser.w" if(re!=0){ result= reduce(*re); if(stop_parse__==ON){ cleanup_stack_due_to_abort(); goto parse_successful; } if(abort_parse__==ON)goto parse_unsuccessful; if(result==Parser::reduced)goto read_token_stream; if(result==Parser::accepted)goto parse_successful; } /*:264*/ //#line 971 "/usr/local/yacco2/library/parser.w" goto parse_unsuccessful; /*:271*/ //#line 932 "/usr/local/yacco2/library/parser.w" } parse_successful: return parallel_parse_successful(); parse_unsuccessful: return parallel_parse_unsuccessful(); } /*:269*//*272:*/ //#line 996 "/usr/local/yacco2/library/parser.w" yacco2:: Parser::parse_result yacco2:: Parser:: parallel_parse_successful(){ /*595:*/ //#line 654 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ if(current_token()!=0){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::"; yacco2::lrclog<<"accept-parallel-parse current token " <<'"'<id__<<'"' <<" pos: "<id__<<" tok pos: " <id__ <<" la tok pos: " < parser*: " <parser()<tok_co_ords__.line_no__ <<" GPS ACCEPT CHR POS: " <tok_co_ords__.pos_in_line__ <tok_co_ords__.line_no__ <<" GPS ACCEPT LA CHR POS: " <tok_co_ords__.pos_in_line__ <id__<<"::"; yacco2::lrclog<<" called thread reducing thread active count of caller thread " <thread_no__<<"::" <fsm_tbl__->id__ <<" active thread count::"<th_active_cnt__ <th_active_cnt__; if(supplier_r_w_cnt__> 1){ --pp_requesting_parallelism__->supplier_r_w_cnt__; if(token_supplier__->r_w_cnt__> 1){ /*391:*/ //#line 3068 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TOKEN_MU); /*:391*/ //#line 1095 "/usr/local/yacco2/library/parser.w" --token_supplier__->r_w_cnt__; /*392:*/ //#line 3072 "/usr/local/yacco2/library/parser.w" UNLOCK_MUTEX(yacco2::TOKEN_MU); /*:392*/ //#line 1097 "/usr/local/yacco2/library/parser.w" } } /*599:*/ //#line 770 "/usr/local/yacco2/library/macros.w" if(YACCO2_MSG__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::"; yacco2::lrclog<<" called thread after reducing thread active count of caller thread " <thread_no__<<"::" <fsm_tbl__->id__ <<" active thread count::"<th_active_cnt__ <put_T_into_accept_queue(pp_rsvp__); /*:278*/ //#line 1005 "/usr/local/yacco2/library/parser.w" clean_up(); return Parser::accepted; } else{ /*273:*/ //#line 1022 "/usr/local/yacco2/library/parser.w" /*380:*/ //#line 2829 "/usr/local/yacco2/library/parser.w" if(yacco2::YACCO2_MU_TH_TBL__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"< Attempting to acquire thread table Mutex"< Acquired thread table Mutex"< Attempting to release thread table Mutex"< Released thread table Mutex"<mu__,*this," of calling grammar"); /*:275*/ //#line 1011 "/usr/local/yacco2/library/parser.w" /*280:*/ //#line 1089 "/usr/local/yacco2/library/parser.w" /*598:*/ //#line 756 "/usr/local/yacco2/library/macros.w" if(YACCO2_MSG__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::"; yacco2::lrclog<<" called thread reducing thread active count of caller thread " <thread_no__<<"::" <fsm_tbl__->id__ <<" active thread count::"<th_active_cnt__ <th_active_cnt__; if(supplier_r_w_cnt__> 1){ --pp_requesting_parallelism__->supplier_r_w_cnt__; if(token_supplier__->r_w_cnt__> 1){ /*391:*/ //#line 3068 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TOKEN_MU); /*:391*/ //#line 1095 "/usr/local/yacco2/library/parser.w" --token_supplier__->r_w_cnt__; /*392:*/ //#line 3072 "/usr/local/yacco2/library/parser.w" UNLOCK_MUTEX(yacco2::TOKEN_MU); /*:392*/ //#line 1097 "/usr/local/yacco2/library/parser.w" } } /*599:*/ //#line 770 "/usr/local/yacco2/library/macros.w" if(YACCO2_MSG__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::"; yacco2::lrclog<<" called thread after reducing thread active count of caller thread " <thread_no__<<"::" <fsm_tbl__->id__ <<" active thread count::"<th_active_cnt__ <put_T_into_accept_queue(pp_rsvp__); /*:278*/ //#line 1013 "/usr/local/yacco2/library/parser.w" clean_up(); /*274:*/ //#line 1028 "/usr/local/yacco2/library/parser.w" /*277:*/ //#line 1048 "/usr/local/yacco2/library/parser.w" if(have_all_threads_reported_back()==YES){ /*621:*/ //#line 1103 "/usr/local/yacco2/library/macros.w" if(yacco2::YACCO2_MSG__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<thread_no__ <<"::"<thread_name() <<" # competing thds: " <no_requested_ths_to_run__ <<" # active thds: " <th_active_cnt__ <thread_no__ <<"::"<thread_name() <<" # competing thds: " <no_requested_ths_to_run__ <<" # active thds: "<th_active_cnt__ <mu__,*this," of calling grammar"); /*:276*/ //#line 1016 "/usr/local/yacco2/library/parser.w" return Parser::accepted; } } /*:272*//*279:*/ //#line 1064 "/usr/local/yacco2/library/parser.w" yacco2:: Parser::parse_result yacco2:: Parser:: parallel_parse_unsuccessful(){ /*281:*/ //#line 1110 "/usr/local/yacco2/library/parser.w" if(fsm_tbl__->failed()==true){ return parallel_parse_successful(); } /*:281*/ //#line 1070 "/usr/local/yacco2/library/parser.w" /*596:*/ //#line 699 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ if(current_token()){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::"; yacco2::lrclog<<"YACCO2_TH__::" <<"#############parallel parse-error current token " <id__<<" pos: "<enumerated_id__ <tok_co_ords__.line_no__ <<" GPS RESET CHR POS: " <tok_co_ords__.pos_in_line__ <id__<<"::"; yacco2::lrclog<<" called thread reducing thread active count of caller thread " <thread_no__<<"::" <fsm_tbl__->id__ <<" active thread count::"<th_active_cnt__ <th_active_cnt__; if(supplier_r_w_cnt__> 1){ --pp_requesting_parallelism__->supplier_r_w_cnt__; if(token_supplier__->r_w_cnt__> 1){ /*391:*/ //#line 3068 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TOKEN_MU); /*:391*/ //#line 1095 "/usr/local/yacco2/library/parser.w" --token_supplier__->r_w_cnt__; /*392:*/ //#line 3072 "/usr/local/yacco2/library/parser.w" UNLOCK_MUTEX(yacco2::TOKEN_MU); /*:392*/ //#line 1097 "/usr/local/yacco2/library/parser.w" } } /*599:*/ //#line 770 "/usr/local/yacco2/library/macros.w" if(YACCO2_MSG__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::"; yacco2::lrclog<<" called thread after reducing thread active count of caller thread " <thread_no__<<"::" <fsm_tbl__->id__ <<" active thread count::"<th_active_cnt__ < Attempting to acquire thread table Mutex"< Acquired thread table Mutex"< Attempting to release thread table Mutex"< Released thread table Mutex"<mu__,*this," of calling grammar"); /*:275*/ //#line 1078 "/usr/local/yacco2/library/parser.w" /*280:*/ //#line 1089 "/usr/local/yacco2/library/parser.w" /*598:*/ //#line 756 "/usr/local/yacco2/library/macros.w" if(YACCO2_MSG__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::"; yacco2::lrclog<<" called thread reducing thread active count of caller thread " <thread_no__<<"::" <fsm_tbl__->id__ <<" active thread count::"<th_active_cnt__ <th_active_cnt__; if(supplier_r_w_cnt__> 1){ --pp_requesting_parallelism__->supplier_r_w_cnt__; if(token_supplier__->r_w_cnt__> 1){ /*391:*/ //#line 3068 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TOKEN_MU); /*:391*/ //#line 1095 "/usr/local/yacco2/library/parser.w" --token_supplier__->r_w_cnt__; /*392:*/ //#line 3072 "/usr/local/yacco2/library/parser.w" UNLOCK_MUTEX(yacco2::TOKEN_MU); /*:392*/ //#line 1097 "/usr/local/yacco2/library/parser.w" } } /*599:*/ //#line 770 "/usr/local/yacco2/library/macros.w" if(YACCO2_MSG__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::"; yacco2::lrclog<<" called thread after reducing thread active count of caller thread " <thread_no__<<"::" <fsm_tbl__->id__ <<" active thread count::"<th_active_cnt__ <thread_no__ <<"::"<thread_name() <<" # competing thds: " <no_requested_ths_to_run__ <<" # active thds: " <th_active_cnt__ <thread_no__ <<"::"<thread_name() <<" # competing thds: " <no_requested_ths_to_run__ <<" # active thds: "<th_active_cnt__ <mu__,*this," of calling grammar"); /*:276*/ //#line 1081 "/usr/local/yacco2/library/parser.w" } fire_off_error_functor: cleanup_stack_due_to_abort(); clean_up(); return Parser::erred; } /*:279*//*282:*/ //#line 1118 "/usr/local/yacco2/library/parser.w" yacco2:: Parser::parse_result yacco2:: Parser:: proc_call_parse_successful(){ /*595:*/ //#line 654 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ if(current_token()!=0){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::"; yacco2::lrclog<<"accept-parallel-parse current token " <<'"'<id__<<'"' <<" pos: "<id__<<" tok pos: " <id__ <<" la tok pos: " < parser*: " <parser()<tok_co_ords__.line_no__ <<" GPS ACCEPT CHR POS: " <tok_co_ords__.pos_in_line__ <tok_co_ords__.line_no__ <<" GPS ACCEPT LA CHR POS: " <tok_co_ords__.pos_in_line__ <put_T_into_accept_queue(pp_rsvp__); /*:278*/ //#line 1125 "/usr/local/yacco2/library/parser.w" clean_up(); return Parser::accepted; } /*:282*//*283:*/ //#line 1134 "/usr/local/yacco2/library/parser.w" yacco2:: Parser::parse_result yacco2:: Parser:: proc_call_parse_unsuccessful(){ /*281:*/ //#line 1110 "/usr/local/yacco2/library/parser.w" if(fsm_tbl__->failed()==true){ return parallel_parse_successful(); } /*:281*/ //#line 1140 "/usr/local/yacco2/library/parser.w" /*597:*/ //#line 727 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ if(current_token()){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::"; yacco2::lrclog<<"YACCO2_TH__::" <<"#############parallel parse-error current token " <id__<<" pos: "<enumerated_id__ <tok_co_ords__.line_no__ <<" GPS RESET CHR POS: " <tok_co_ords__.pos_in_line__ <enumerated_id__; State*State_ptr= pr->state__; Shift_tbl*st= State_ptr->shift_tbl_ptr__; yacco2::USINT cnt= st->no_entries__; Shift_entry_array_type*shft_entry_array= (Shift_entry_array_type*)&st->first_entry__; yacco2::Shift_entry*k_entry; if(cnt> SEQ_SRCH_VS_BIN_SRCH_LIMIT)goto bin_srch; for(int x= 0;xid__)return k_entry; if(Enum_idid__)break; } eolr_seq: for(int x= 0;xid__)return k_entry; if(LR1_Eolrid__)return 0; } return 0; bin_srch: int lower= 1; int upper= cnt; int seg_ln; int mid_pt; int mid_pt_rel0; B2: if(upper>1; mid_pt_rel0= mid_pt-1; k_entry= &(*shft_entry_array)[mid_pt_rel0]; B3: if(Enum_id==k_entry->id__)return k_entry; if(Enum_id> k_entry->id__)goto B5; B4: upper= mid_pt-1; goto B2; B5: lower= mid_pt+1; goto B2; eolr_srch: lower= 1; upper= st->no_entries__; B2_eolr: if(upper>1; mid_pt_rel0= mid_pt-1; k_entry= &(*shft_entry_array)[mid_pt_rel0]; if(LR1_Eolr==k_entry->id__)return k_entry; if(LR1_Eolr> k_entry->id__)goto B5_eolr; B4_eolr: upper= mid_pt-1; goto B2_eolr; B5_eolr: lower= mid_pt+1; goto B2_eolr; return 0; } /*:284*//*285:*/ //#line 1221 "/usr/local/yacco2/library/parser.w" yacco2::Shift_entry* yacco2:: Parser:: find_R_or_paralleled_T_shift_entry(yacco2::USINT Enum_id){ /*352:*/ //#line 2415 "/usr/local/yacco2/library/parser.w" Cparse_record*pr= parse_stack__.top__; /*:352*/ //#line 1226 "/usr/local/yacco2/library/parser.w" State*State_ptr= pr->state__; Shift_tbl*st= State_ptr->shift_tbl_ptr__; yacco2::USINT cnt= st->no_entries__; Shift_entry_array_type*shft_entry_array= (Shift_entry_array_type*)&st->first_entry__; yacco2::Shift_entry*k_entry; if(cnt> SEQ_SRCH_VS_BIN_SRCH_LIMIT)goto bin_srch; for(int x= 0;x=cnt)break; k_entry= &(*shft_entry_array)[x]; if(Enum_id==k_entry->id__)return k_entry; if(Enum_idid__)break; } eolr_seq: for(int x= 0;x=cnt)break; k_entry= &(*shft_entry_array)[x]; if(LR1_Eolr==k_entry->id__)return k_entry; if(LR1_Eolrid__)return 0; } return 0; bin_srch: int lower= 1; int upper= cnt; int seg_ln; int mid_pt; int mid_pt_rel0; B2: if(upper>1; mid_pt_rel0= mid_pt-1; k_entry= &(*shft_entry_array)[mid_pt_rel0]; B3: if(Enum_id==k_entry->id__)return k_entry; if(Enum_id> k_entry->id__)goto B5; B4: upper= mid_pt-1; goto B2; B5: lower= mid_pt+1; goto B2; eolr_srch: lower= 1; upper= st->no_entries__; B2_eolr: if(upper>1; mid_pt_rel0= mid_pt-1; k_entry= &(*shft_entry_array)[mid_pt_rel0]; if(LR1_Eolr==k_entry->id__)return k_entry; if(LR1_Eolr> k_entry->id__)goto B5_eolr; B4_eolr: upper= mid_pt-1; goto B2_eolr; B5_eolr: lower= mid_pt+1; goto B2_eolr; return 0; } /*:285*//*286:*/ //#line 1289 "/usr/local/yacco2/library/parser.w" void add_set_to_map(yacco2::yacco2_set_type&Map,int Partition,int Element){ yacco2::yacco2_set_iter_type e= Map.find(Partition); if(e==Map.end()){ Map[Partition]= Element; }else{ int se= e->second; int v= se+Element; e->second= v; } } /*:286*//*288:*/ //#line 1337 "/usr/local/yacco2/library/parser.w" yacco2::Reduce_entry* yacco2:: Parser:: find_questionable_sym_in_reduce_lookahead(){ /*352:*/ //#line 2415 "/usr/local/yacco2/library/parser.w" Cparse_record*pr= parse_stack__.top__; /*:352*/ //#line 1342 "/usr/local/yacco2/library/parser.w" State*State_ptr= pr->state__; UCHAR partition; UCHAR element; int lower; int upper; int seg_ln; int mid_pt; int mid_pt_rel0; yacco2::Set_entry*k_entry; Reduce_tbl*rt= State_ptr->reduce_tbl_ptr__; yacco2::USINT cnt_of_reducing_subrules= rt->no_entries__; Reduce_entry*re= (Reduce_entry*)&rt->first_entry__; yacco2::Set_tbl*pla_set; yacco2::INT no_set_pairs; for(yacco2::UINT x= 1;x<=cnt_of_reducing_subrules;++x,++re){ pla_set= re->la_set__; no_set_pairs= pla_set->no_entries__; Set_entry_array_type*set_entry_array= (Set_entry_array_type*)&(pla_set->first_entry__); if(no_set_pairs> SEQ_SRCH_VS_BIN_SRCH_LIMIT)goto QUE_srch; for(int x= 0;xpartition__){ if(LRK_LA_QUE_SET.elements__&k_entry->elements__){ return re; }else{ break; } } if(LRK_LA_QUE_SET.partition__partition__)break; } continue; QUE_srch: lower= 1; upper= no_set_pairs; B2_que: if(upper>1; mid_pt_rel0= mid_pt-1; k_entry= &(*set_entry_array)[mid_pt_rel0]; if(LRK_LA_QUE_SET.partition__==k_entry->partition__){ if(LRK_LA_QUE_SET.elements__&k_entry->elements__){ return re; }else{ continue; } } if(LRK_LA_QUE_SET.partition__> k_entry->partition__)goto B5_que; B4_que: upper= mid_pt-1; goto B2_que; B5_que: lower= mid_pt+1; goto B2_que; } return 0; } /*:288*//*289:*/ //#line 1436 "/usr/local/yacco2/library/parser.w" yacco2::Reduce_entry* yacco2:: Parser:: find_reduce_entry(){ /*352:*/ //#line 2415 "/usr/local/yacco2/library/parser.w" Cparse_record*pr= parse_stack__.top__; /*:352*/ //#line 1441 "/usr/local/yacco2/library/parser.w" State*State_ptr= pr->state__; UCHAR partition= current_token__->tok_co_ords__.set_entry__.partition__; UCHAR element= current_token__->tok_co_ords__.set_entry__.elements__; int cp= partition; int ce= element; Reduce_tbl*rt= State_ptr->reduce_tbl_ptr__; yacco2::USINT cnt_of_reducing_subrules= rt->no_entries__; Reduce_entry*re= (Reduce_entry*)&rt->first_entry__; yacco2::Set_tbl*pla_set; yacco2::INT no_set_pairs; int lower; int upper; int seg_ln; int mid_pt; int mid_pt_rel0; yacco2::Set_entry*k_entry; if(has_questionable_shift_occured__==ON){ return re; } /*291:*/ //#line 1478 "/usr/local/yacco2/library/parser.w" { Pass1_reduce: re= (Reduce_entry*)&rt->first_entry__; for(yacco2::UINT x= 1;x<=cnt_of_reducing_subrules;++x,++re){ pla_set= re->la_set__; no_set_pairs= pla_set->no_entries__; Set_entry_array_type*set_entry_array= (Set_entry_array_type*)&(pla_set->first_entry__); if(no_set_pairs> SEQ_SRCH_VS_BIN_SRCH_LIMIT){ /*293:*/ //#line 1508 "/usr/local/yacco2/library/parser.w" { bin_srch_cur_tok: lower= 1; upper= no_set_pairs; B2: if(upper>1; mid_pt_rel0= mid_pt-1; k_entry= &(*set_entry_array)[mid_pt_rel0]; B3: if(partition==k_entry->partition__){ if(element&k_entry->elements__){ return re; }else{ goto srch_end_cur_tok; } } if(partition> k_entry->partition__)goto B5; B4: upper= mid_pt-1; goto B2; B5: lower= mid_pt+1; goto B2; srch_end_cur_tok:; } /*:293*/ //#line 1487 "/usr/local/yacco2/library/parser.w" }else{ /*292:*/ //#line 1494 "/usr/local/yacco2/library/parser.w" for(int xx= 0;xxpartition__){ if(element&k_entry->elements__){ return re; }else{ break; } } if(partitionpartition__)break; } /*:292*/ //#line 1489 "/usr/local/yacco2/library/parser.w" } } } /*:291*/ //#line 1462 "/usr/local/yacco2/library/parser.w" /*294:*/ //#line 1542 "/usr/local/yacco2/library/parser.w" { re= (Reduce_entry*)&rt->first_entry__; for(yacco2::UINT x= 1;x<=cnt_of_reducing_subrules;++x,++re){ pla_set= re->la_set__; no_set_pairs= pla_set->no_entries__; Set_entry_array_type*set_entry_array= (Set_entry_array_type*)&(pla_set->first_entry__); if(no_set_pairs> SEQ_SRCH_VS_BIN_SRCH_LIMIT){ /*296:*/ //#line 1575 "/usr/local/yacco2/library/parser.w" { bin_srch_meta: lower= 1; upper= no_set_pairs; Meta_srch: lower= 1; upper= no_set_pairs; B2_meta: if(upper>1; mid_pt_rel0= mid_pt-1; k_entry= &(*set_entry_array)[mid_pt_rel0]; if(LRK_LA_EOLR_SET.partition__==k_entry->partition__){ if(LRK_LA_EOLR_SET.elements__&k_entry->elements__){ return re; }else{ continue; } } if(LRK_LA_EOLR_SET.partition__> k_entry->partition__)goto B5_meta; B4_meta: upper= mid_pt-1; goto B2_meta; B5_meta: lower= mid_pt+1; goto B2_meta; } /*:296*/ //#line 1551 "/usr/local/yacco2/library/parser.w" }else{ /*295:*/ //#line 1558 "/usr/local/yacco2/library/parser.w" { seq_meta: for(int x= 0;xpartition__){ if(LRK_LA_EOLR_SET.elements__&k_entry->elements__){ return re; }else{ break; } } if(LRK_LA_EOLR_SET.partition__partition__)break; } } /*:295*/ //#line 1553 "/usr/local/yacco2/library/parser.w" } } } /*:294*/ //#line 1463 "/usr/local/yacco2/library/parser.w" return find_questionable_sym_in_reduce_lookahead(); } /*:289*//*297:*/ //#line 1614 "/usr/local/yacco2/library/parser.w" yacco2::Reduce_entry* yacco2:: Parser:: find_parallel_reduce_entry(){ /*352:*/ //#line 2415 "/usr/local/yacco2/library/parser.w" Cparse_record*pr= parse_stack__.top__; /*:352*/ //#line 1619 "/usr/local/yacco2/library/parser.w" State*State_ptr= pr->state__; Reduce_tbl*rt= State_ptr->reduce_tbl_ptr__; Reduce_entry*re= (Reduce_entry*)&rt->first_entry__; return re; } /*:297*//*298:*/ //#line 1632 "/usr/local/yacco2/library/parser.w" yacco2::Reduce_entry* yacco2:: Parser:: find_proc_call_reduce_entry(){ /*352:*/ //#line 2415 "/usr/local/yacco2/library/parser.w" Cparse_record*pr= parse_stack__.top__; /*:352*/ //#line 1637 "/usr/local/yacco2/library/parser.w" State*State_ptr= pr->state__; Reduce_tbl*rt= State_ptr->reduce_tbl_ptr__; Reduce_entry*re= (Reduce_entry*)&rt->first_entry__; return re; } /*:298*//*300:*/ //#line 1646 "/usr/local/yacco2/library/parser.w" yacco2:: CAbs_lr1_sym* yacco2:: Parser:: start_token(){ return start_token__; } /*:300*//*301:*/ //#line 1656 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: set_start_token(CAbs_lr1_sym&Token){ start_token__= &Token; } /*:301*//*302:*/ //#line 1665 "/usr/local/yacco2/library/parser.w" yacco2::UINT yacco2:: Parser:: start_token_pos(){ return start_token_pos__; } /*:302*//*303:*/ //#line 1674 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: set_start_token_pos(yacco2::UINT Pos){ start_token_pos__= Pos; } /*:303*//*305:*/ //#line 1700 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: set_use_all_shift_on(){ use_all_shift__= ON; } /*:305*//*306:*/ //#line 1709 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: set_use_all_shift_off(){ use_all_shift__= OFF; } /*:306*//*307:*/ //#line 1718 "/usr/local/yacco2/library/parser.w" bool yacco2:: Parser:: use_all_shift(){ return use_all_shift__; } /*:307*//*309:*/ //#line 1734 "/usr/local/yacco2/library/parser.w" yacco2::tble_lkup_type* yacco2:: Parser:: sym_lookup_functor(){ return sym_lookup_functor__; } /*:309*//*310:*/ //#line 1743 "/usr/local/yacco2/library/parser.w" bool yacco2:: Parser:: abort_parse(){ return abort_parse__; } /*:310*//*311:*/ //#line 1753 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: set_abort_parse(bool Abort){ abort_parse__= Abort; } /*:311*//*312:*/ //#line 1761 "/usr/local/yacco2/library/parser.w" bool yacco2:: Parser:: stop_parse(){ return stop_parse__; } /*:312*//*313:*/ //#line 1783 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: set_stop_parse(bool Stop){ stop_parse__= Stop; } /*:313*//*315:*/ //#line 1795 "/usr/local/yacco2/library/parser.w" yacco2::CAbs_fsm* yacco2:: Parser:: fsm_tbl(){ return fsm_tbl__; } /*:315*//*318:*/ //#line 1844 "/usr/local/yacco2/library/parser.w" yacco2::token_container_type* yacco2:: Parser:: token_supplier(){ return token_supplier__; } /*:318*//*319:*/ //#line 1853 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: set_token_supplier(yacco2::token_container_type&Token_supplier){ token_supplier__= &Token_supplier; } /*:319*//*320:*/ //#line 1862 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: add_token_to_supplier(yacco2::CAbs_lr1_sym&Token){ if(token_supplier__->r_w_cnt__> 1) /*391:*/ //#line 3068 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TOKEN_MU); /*:391*/ //#line 1868 "/usr/local/yacco2/library/parser.w" token_supplier__->push_back(Token); if(token_supplier__->r_w_cnt__> 1) /*392:*/ //#line 3072 "/usr/local/yacco2/library/parser.w" UNLOCK_MUTEX(yacco2::TOKEN_MU); /*:392*/ //#line 1871 "/usr/local/yacco2/library/parser.w" } /*:320*//*322:*/ //#line 1879 "/usr/local/yacco2/library/parser.w" yacco2::token_container_type* yacco2:: Parser:: token_producer(){ return token_producer__; } /*:322*//*323:*/ //#line 1888 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: set_token_producer(yacco2::token_container_type&Token_producer){ token_producer__= &Token_producer; } /*:323*//*324:*/ //#line 1897 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: add_token_to_producer(yacco2::CAbs_lr1_sym&Token){ /*391:*/ //#line 3068 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TOKEN_MU); /*:391*/ //#line 1902 "/usr/local/yacco2/library/parser.w" token_producer__->push_back(Token); /*392:*/ //#line 3072 "/usr/local/yacco2/library/parser.w" UNLOCK_MUTEX(yacco2::TOKEN_MU); /*:392*/ //#line 1904 "/usr/local/yacco2/library/parser.w" } /*:324*//*326:*/ //#line 1914 "/usr/local/yacco2/library/parser.w" yacco2::token_container_type* yacco2:: Parser:: recycle_bin(){ return recycle_bin__; } /*:326*//*327:*/ //#line 1923 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: set_recycle_bin(yacco2::token_container_type&Recycle_bin){ recycle_bin__= &Recycle_bin; } /*:327*//*328:*/ //#line 1932 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: add_token_to_recycle_bin(yacco2::CAbs_lr1_sym&Token){ /*391:*/ //#line 3068 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TOKEN_MU); /*:391*/ //#line 1937 "/usr/local/yacco2/library/parser.w" recycle_bin__->push_back(Token); /*392:*/ //#line 3072 "/usr/local/yacco2/library/parser.w" UNLOCK_MUTEX(yacco2::TOKEN_MU); /*:392*/ //#line 1939 "/usr/local/yacco2/library/parser.w" } /*:328*//*330:*/ //#line 1956 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: set_error_queue(yacco2::token_container_type&Error_queue){ error_queue__= &Error_queue; } /*:330*//*331:*/ //#line 1965 "/usr/local/yacco2/library/parser.w" yacco2::token_container_type* yacco2:: Parser:: error_queue(){return error_queue__;} /*:331*//*332:*/ //#line 1972 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: add_token_to_error_queue(yacco2::CAbs_lr1_sym&Token){ /*557:*/ //#line 167 "/usr/local/yacco2/library/constraints.w" if(error_queue__==0){ yacco2::KCHARP msg= "Error - Trying to add to Parser error_queue__ which is zero ptr"; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:557*/ //#line 1977 "/usr/local/yacco2/library/parser.w" /*391:*/ //#line 3068 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TOKEN_MU); /*:391*/ //#line 1978 "/usr/local/yacco2/library/parser.w" error_queue__->push_back(Token); /*392:*/ //#line 3072 "/usr/local/yacco2/library/parser.w" UNLOCK_MUTEX(yacco2::TOKEN_MU); /*:392*/ //#line 1980 "/usr/local/yacco2/library/parser.w" } /*:332*//*334:*/ //#line 2006 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: put_T_into_accept_queue(yacco2::Caccept_parse&Calling_parm){ ++th_accepting_cnt__; if(th_accepting_cnt__ MAX_LR_STK_ITEMS)return 0; Cparse_record*pr= parse_stack__.sf_by_sub(Pos); return pr->symbol__; } /*:336*//*337:*/ //#line 2130 "/usr/local/yacco2/library/parser.w" yacco2::CAbs_lr1_sym* yacco2:: Parser:: get_next_token(){ if(token_supplier__==0)return 0; if(token_supplier__->empty()==true){ current_token__= yacco2::PTR_LR1_eog__; return current_token__; } if(current_token_pos__>=token_supplier__->size()){ current_token__= yacco2::PTR_LR1_eog__; return current_token__; } ++current_token_pos__; if(current_token_pos__>=token_supplier__->size()){ current_token__= yacco2::PTR_LR1_eog__; return current_token__; } if(YACCO2_T__!=0){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<enumerated_id__<<' ' <<'"'<id__<<'"'<<" token fetched*: " <tok_co_ords__.line_no__ <<" GPS CHR POS: " <tok_co_ords__.pos_in_line__ <tok_co_ords__.line_no__ <<" GPS CHR POS: " <tok_co_ords__.pos_in_line__ <lkup__==ON!=0){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<enumerated_id__<<' ' <<" after remap " <<'"'<id__<<'"'<<" token fetched*: " <tok_co_ords__.line_no__ <<" GPS CHR POS: " <tok_co_ords__.pos_in_line__ < token_supplier__->size()){ yacco2::KCHARP msg= "Error - Pos out of bounds against supplier"; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:553*/ //#line 2223 "/usr/local/yacco2/library/parser.w" /*339:*/ //#line 2283 "/usr/local/yacco2/library/parser.w" if(token_supplier__->empty()==YES)return 0; /*:339*/ //#line 2224 "/usr/local/yacco2/library/parser.w" if(YACCO2_T__!=0){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<" pos: " <enumerated_id__ <<'"'<id__<<'"' <tok_co_ords__.line_no__ <<" GPS CHR POS: " <tok_co_ords__.pos_in_line__ <lkup__==ON!=0){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<" pos: " <enumerated_id__ <<" after remap " <<'"'<id__<<'"' <tok_co_ords__.line_no__ <<" GPS CHR POS: " <tok_co_ords__.pos_in_line__ < 0){ remove_from_stack(stack_items_to_process); } set_abort_parse(OFF); set_stop_parse(OFF); } /*:342*//*343:*/ //#line 2311 "/usr/local/yacco2/library/parser.w" yacco2::INT yacco2:: Parser:: current_stack_pos(){ return parse_stack__.top_sub__; } /*:343*//*344:*/ //#line 2320 "/usr/local/yacco2/library/parser.w" yacco2::lr_stk* yacco2:: Parser:: parse_stack(){ return&parse_stack__; } /*:344*//*345:*/ //#line 2329 "/usr/local/yacco2/library/parser.w" yacco2::Cparse_record* yacco2:: Parser:: top_stack_record(){ if(parse_stack__.top_sub__<1)return 0; /*352:*/ //#line 2415 "/usr/local/yacco2/library/parser.w" Cparse_record*pr= parse_stack__.top__; /*:352*/ //#line 2336 "/usr/local/yacco2/library/parser.w" return pr; } /*:345*//*346:*/ //#line 2343 "/usr/local/yacco2/library/parser.w" yacco2::Cparse_record* yacco2:: Parser:: get_stack_record(yacco2::INT Pos){ /*554:*/ //#line 125 "/usr/local/yacco2/library/constraints.w" if(Pos=(parse_stack__.top_sub__))return 0; return parse_stack__.sf_by_sub(Pos+1); } /*:346*//*347:*/ //#line 2360 "/usr/local/yacco2/library/parser.w" yacco2::INT yacco2:: Parser:: no_items_on_stack(){ return parse_stack__.top_sub__; } /*:347*//*348:*/ //#line 2370 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: add_to_stack(yacco2::State&State){ parse_stack__.push_state(State); /*581:*/ //#line 373 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); } /*:581*/ //#line 2376 "/usr/local/yacco2/library/parser.w" } /*:348*//*350:*/ //#line 2395 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: remove_from_stack(yacco2::INT No_to_remove){ /*555:*/ //#line 137 "/usr/local/yacco2/library/constraints.w" if(No_to_remove<0){ yacco2::KCHARP msg= "Error - parse stack number of removal items < 0"; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:555*/ //#line 2400 "/usr/local/yacco2/library/parser.w" /*556:*/ //#line 146 "/usr/local/yacco2/library/constraints.w" if(parse_stack__.top_sub__<1){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "FSM id: %s parse stack empty!"; sprintf(a,msg,fsm_tbl__->id__); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } if(No_to_remove> MAX_LR_STK_ITEMS){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "Error - Underflow FSM id: %s on parse stack size:%i removal request: %i "; sprintf(a,msg,fsm_tbl__->id__,MAX_LR_STK_ITEMS,No_to_remove); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } /*:556*/ //#line 2401 "/usr/local/yacco2/library/parser.w" /*351:*/ //#line 2407 "/usr/local/yacco2/library/parser.w" if(No_to_remove==0){ /*582:*/ //#line 379 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::epsilon" <debug__==ON){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<":: Popping items from stack # to pop: " < 0){ /*583:*/ //#line 392 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::popped state:: "; yacco2::lrclog <state__->state_no__ <symbol__= 0; pr->aborted__= 0; pr->rule_s_reuse_entry_ptr__= 0; /*:354*/ //#line 2438 "/usr/local/yacco2/library/parser.w" /*355:*/ //#line 2428 "/usr/local/yacco2/library/parser.w" --parse_stack__.top_sub__; --parse_stack__.top__; /*:355*/ //#line 2439 "/usr/local/yacco2/library/parser.w" /*353:*/ //#line 2419 "/usr/local/yacco2/library/parser.w" pr= parse_stack__.top__; /*:353*/ //#line 2440 "/usr/local/yacco2/library/parser.w" /*:356*/ //#line 2515 "/usr/local/yacco2/library/parser.w" /*357:*/ //#line 2452 "/usr/local/yacco2/library/parser.w" if(pr->symbol__==0){ /*584:*/ //#line 410 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__ <<"::exposed rule/terminal:: NULL due to invisible shift" <id__ <<"::exposed rule/terminal:: "<symbol__->id__ <<' '<symbol__ <rule_s_reuse_entry_ptr__!=0){ fsm_tbl__->recycle_rule(pr->rule_s_reuse_entry_ptr__); pr->rule_s_reuse_entry_ptr__= 0; } else{ if(pr->symbol__->auto_delete__==ON){ /*586:*/ //#line 441 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ if(parse_stack__.top__->symbol__->auto_delete__==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__ <<"::AD deleting exposed rule/terminal:: " <symbol__->id__<<' ' <symbol__ <symbol__->dtor__!=0) (*pr->symbol__->dtor__)(pr->symbol__,this); delete pr->symbol__; pr->symbol__= 0; goto next_stack_element_to_remove; } } /*:358*/ //#line 2518 "/usr/local/yacco2/library/parser.w" /*359:*/ //#line 2482 "/usr/local/yacco2/library/parser.w" if(pr->aborted__==0)goto next_stack_element_to_remove; /*:359*/ //#line 2520 "/usr/local/yacco2/library/parser.w" /*587:*/ //#line 464 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ if(parse_stack__.top__->symbol__->affected_by_abort__==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__ <<"::AB deleting exposed rule/terminal:: " <symbol__->id__<<' ' <symbol__ <rule_s_reuse_entry_ptr__!=0){ fsm_tbl__->recycle_rule(pr->rule_s_reuse_entry_ptr__); pr->rule_s_reuse_entry_ptr__= 0; }else{ if(pr->symbol__->affected_by_abort__==OFF)goto next_stack_element_to_remove; if(pr->symbol__->dtor__!=0) (*pr->symbol__->dtor__)(pr->symbol__,this); delete pr->symbol__; } /*:360*/ //#line 2523 "/usr/local/yacco2/library/parser.w" /*354:*/ //#line 2423 "/usr/local/yacco2/library/parser.w" pr->symbol__= 0; pr->aborted__= 0; pr->rule_s_reuse_entry_ptr__= 0; /*:354*/ //#line 2524 "/usr/local/yacco2/library/parser.w" next_stack_element_to_remove: --No_to_remove; } /*580:*/ //#line 359 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ if(fsm_tbl__->debug__==ON){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<":: Finished Popping items from stack" < 0)remove_from_stack(s); if(s==0){ /*352:*/ //#line 2415 "/usr/local/yacco2/library/parser.w" Cparse_record*pr= parse_stack__.top__; /*:352*/ //#line 2539 "/usr/local/yacco2/library/parser.w" if(pr->rule_s_reuse_entry_ptr__!=0){ pr->rule_s_reuse_entry_ptr__= 0; } } } /*:362*//*364:*/ //#line 2552 "/usr/local/yacco2/library/parser.w" yacco2::CAbs_lr1_sym* yacco2:: Parser:: current_token(){ Remap_token(current_token__) Remap_set_result_and_return(current_token__) } /*:364*//*365:*/ //#line 2565 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: reset_current_token(yacco2::UINT Pos){ /*552:*/ //#line 101 "/usr/local/yacco2/library/constraints.w" if(token_supplier__==0){ yacco2::KCHARP msg= "Error - parser's supplier is zero ptr"; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:552*/ //#line 2570 "/usr/local/yacco2/library/parser.w" /*553:*/ //#line 110 "/usr/local/yacco2/library/constraints.w" if(Pos> token_supplier__->size()){ yacco2::KCHARP msg= "Error - Pos out of bounds against supplier"; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:553*/ //#line 2571 "/usr/local/yacco2/library/parser.w" if(YACCO2_T__!=0){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<" pos: " <enumerated_id__ <<'"'<id__<<'"' <tok_co_ords__.line_no__ <<" GPS CHR POS: " <tok_co_ords__.pos_in_line__ < before procedure call" <first_entry__; int no_thds= thd_stable->no_entries__-1; if((Thread_id> no_thds)){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "spawn_thread_manually thread id: %i out of bounds 0 to %i: no thread available"; sprintf(a,msg,Thread_id,no_thds); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } th_lst__.clear(); Thread_entry*pe= thd_tbl[Thread_id]; th_lst__.push_back(pe); return start_threads(); } /*:376*//*385:*/ //#line 2996 "/usr/local/yacco2/library/parser.w" bool yacco2:: Parser::start_threads(){ /*610:*/ //#line 923 "/usr/local/yacco2/library/macros.w" if(yacco2::YACCO2_MSG__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__ <<" --> start threads" < 1){ if(supplier_r_w_cnt__==1){ if(token_supplier__!=0){token_supplier__->r_w_cnt__= new_r_w_cnt;} }else{ if(token_supplier__!=0){ /*391:*/ //#line 3068 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TOKEN_MU); /*:391*/ //#line 2956 "/usr/local/yacco2/library/parser.w" token_supplier__->r_w_cnt__= new_r_w_cnt; /*392:*/ //#line 3072 "/usr/local/yacco2/library/parser.w" UNLOCK_MUTEX(yacco2::TOKEN_MU); /*:392*/ //#line 2958 "/usr/local/yacco2/library/parser.w" } } } Thread_entry*pe= *i; /*380:*/ //#line 2829 "/usr/local/yacco2/library/parser.w" if(yacco2::YACCO2_MU_TH_TBL__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"< Attempting to acquire thread table Mutex"< Acquired thread table Mutex"< 1)goto thread_call; procedure_call:{ if(Parallel_thread_proc_call_table[pe->thd_id__].proc_call_in_use__==true){ /*623:*/ //#line 1134 "/usr/local/yacco2/library/macros.w" if(yacco2::YACCO2_MSG__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<thread_no__ <<"::"<thread_name() <thd_id__].proc_call_in_use__= true; /*381:*/ //#line 2843 "/usr/local/yacco2/library/parser.w" if(yacco2::YACCO2_MU_TH_TBL__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"< Attempting to release thread table Mutex"< Released thread table Mutex"< before procedure call" <proc_thread_fnct_ptr__)(this); /*380:*/ //#line 2829 "/usr/local/yacco2/library/parser.w" if(yacco2::YACCO2_MU_TH_TBL__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"< Attempting to acquire thread table Mutex"< Acquired thread table Mutex"<thd_id__].proc_call_in_use__= false; /*381:*/ //#line 2843 "/usr/local/yacco2/library/parser.w" if(yacco2::YACCO2_MU_TH_TBL__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"< Attempting to release thread table Mutex"< Released thread table Mutex"<thread_fnct_name__ <<" thread proc*: "<thread_fnct_ptr__ <<" thread id: "<thd_id__ <thd_id__]; Parallel_thread_list_iterator_type j; Parallel_thread_list_iterator_type je; worker_thread_blk*tb; if(i.empty()==true){ thread_disposition= NO_THREAD_AT_ALL; goto dispatch_disposition; } j= i.begin(); je= i.end(); for(;j!=je;++j){ tb= *j; /*619:*/ //#line 1068 "/usr/local/yacco2/library/macros.w" if(yacco2::YACCO2_MSG__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<grammar_s_parser__->thread_no__ <<"::"<grammar_s_parser__->thread_name() <<" th_blk*: "<grammar_s_parser__ <<" #: "<thd_id__ <<" st: "<status__ <<" thds in launched list " <" <grammar_s_parser__->thread_no__ <<"::"<grammar_s_parser__->fsm_tbl__->id__ <status__==THREAD_WAITING_FOR_WORK){ thread_disposition= THREAD_WAITING_FOR_WORK; goto dispatch_disposition; } } thread_disposition= ALL_THREADS_BUSY; goto dispatch_disposition; /*:382*/ //#line 2986 "/usr/local/yacco2/library/parser.w" dispatch_disposition: /*383:*/ //#line 2892 "/usr/local/yacco2/library/parser.w" switch(thread_disposition){ case THREAD_WAITING_FOR_WORK:{ LOCK_MUTEX_OF_CALLED_PARSER(tb->grammar_s_parser__->mu__ ,*tb->grammar_s_parser__," of self"); tb->status__= THREAD_WORKING; ++tb->run_cnt__; tb->grammar_s_parser__->pp_requesting_parallelism__= this; tb->grammar_s_parser__->no_competing_pp_ths__= this->no_requested_ths_to_run__; tb->grammar_s_parser__->from_thread__= this; /*611:*/ //#line 940 "/usr/local/yacco2/library/macros.w" if(yacco2::YACCO2_MSG__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"< parallel thread worker fnd in thread table CALL WORKER: " <grammar_s_parser__->thread_name() <<" thread obj*:"<grammar_s_parser__ <<" parm*: "<grammar_s_parser__->pp_requesting_parallelism__ <grammar_s_parser__->mu__ ,*tb->grammar_s_parser__," of self"); SIGNAL_COND_VAR(*tb->grammar_s_parser__,*this); break; } case NO_THREAD_AT_ALL:{ /*613:*/ //#line 970 "/usr/local/yacco2/library/macros.w" if(yacco2::YACCO2_MSG__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<thread_fnct_name__ <<" --> parallel thread NOT fnd in thread table" <thread_fnct_ptr__,*this); break; } case ALL_THREADS_BUSY:{ /*612:*/ //#line 959 "/usr/local/yacco2/library/macros.w" if(yacco2::YACCO2_MSG__){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<thread_fnct_name__ <<" --> parallel thread fnd in thread table BUT ALL ARE BUSY " <thread_fnct_ptr__,*this); break; } } /*:383*/ //#line 2988 "/usr/local/yacco2/library/parser.w" /*591:*/ //#line 560 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<thread_fnct_name__ < Attempting to release thread table Mutex"< Released thread table Mutex"<WAIT_FOR_EVENT " <<" # threads to run:: "<thread_no__ <<"::"<thread_name() < Posting message to: " < before SIGNAL_COND_VAR() to signal wakeup grammar for: " < after SIGNAL_COND_VAR() to waken grammar of " <th_active_cnt__==0)return YES; return NO; } /*:399*//*401:*/ //#line 3198 "/usr/local/yacco2/library/parser.w" void yacco2:: Parser:: abort_accept_queue_irregularites (yacco2::Caccept_parse&Calling_parm){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__,top_stack_record()->state__->state_no__); yacco2::lrclog<thread_fnct_name__); yacco2::lrclog<id__ ,pp_accept_queue__[i].accept_token_pos__); yacco2::lrclog<id__,top_stack_record()->state__->state_no__); yacco2::lrclog<thread_fnct_name__); yacco2::lrclog<id__ ,pp_accept_queue__[i].accept_token_pos__); yacco2::lrclog< 1){ for(int x= 1;x<=th_accepting_cnt__;++x){ if(x==pp_accept_queue_idx__)continue; if(pp_accept_queue__[x].accept_token__->auto_delete()==YES){ delete pp_accept_queue__[x].accept_token__; } pp_accept_queue__[x].initialize_it(); } } th_active_cnt__= 0; th_accepting_cnt__= 0; pp_accept_queue_idx__= 0; } /*:414*//*418:*/ //#line 3411 "/usr/local/yacco2/library/parser.w" yacco2:: THR_result yacco2:: Parser:: chained_proc_call_parsing(yacco2::State&S){ THR_result result= start_procedure_call(S); /*594:*/ //#line 636 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ if(no_requested_ths_to_run__> 1){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::" <<"parallel parsing received message from id:" <thread_no__<<"::" <thread_name() <set_symbol(NS_yacco2_k_symbols::PTR_LR1_fset_transience_operator__); State*Goto_state= S.proc_call_shift__->goto__; /*349:*/ //#line 2379 "/usr/local/yacco2/library/parser.w" /*132:*/ //#line 226 "/usr/local/yacco2/library/parse_env.w" if(parse_stack__.top_sub__>=MAX_LR_STK_ITEMS){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "lr_stk - push overflow stack max: %i"; sprintf(a,msg,MAX_LR_STK_ITEMS); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } ++parse_stack__.top__; ++parse_stack__.top_sub__; parse_stack__.top__->state__= Goto_state; parse_stack__.top__->symbol__= 0; parse_stack__.top__->aborted__= 0; parse_stack__.top__->rule_s_reuse_entry_ptr__= 0; /*:132*/ //#line 2380 "/usr/local/yacco2/library/parser.w" /*:349*/ //#line 3407 "/usr/local/yacco2/library/parser.w" /*:417*/ //#line 3422 "/usr/local/yacco2/library/parser.w" /*411:*/ //#line 3344 "/usr/local/yacco2/library/parser.w" override_current_token(*arbitrated_token__->accept_token__ ,arbitrated_token__->accept_token_pos__); /*:411*/ //#line 3423 "/usr/local/yacco2/library/parser.w" /*592:*/ //#line 574 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<accept_token_pos__ <<" token*: "<accept_token__<<" token: " <accept_token__->id__<accept_token__) yacco2::lrclog <<" GPS LINE: " <accept_token__->tok_co_ords__.line_no__ <<" GPS CHR POS: " <accept_token__->tok_co_ords__.pos_in_line__ <la_token_pos__<<" la token: " <la_token__->id__<la_token__) yacco2::lrclog <<" GPS LA LINE: " <la_token__->tok_co_ords__.line_no__ <<" GPS LA CHR POS: " <la_token__->tok_co_ords__.pos_in_line__ <accept_token__); /*410:*/ //#line 3340 "/usr/local/yacco2/library/parser.w" override_current_token(*arbitrated_token__->la_token__,arbitrated_token__->la_token_pos__); /*:410*/ //#line 3426 "/usr/local/yacco2/library/parser.w" /*593:*/ //#line 612 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__ <tok_co_ords__.line_no__ <<" GPS RE-ALIGN CHR POS: " <tok_co_ords__.pos_in_line__ <accept_token__= 0; /*:408*/ //#line 3428 "/usr/local/yacco2/library/parser.w" clean_up(); return Parser::paralleled; } proc_call_unsuccessful: /*405:*/ //#line 3299 "/usr/local/yacco2/library/parser.w" clean_up(); return Parser::erred; /*:405*/ //#line 3433 "/usr/local/yacco2/library/parser.w" } /*:418*//*421:*/ //#line 3450 "/usr/local/yacco2/library/parser.w" yacco2:: Parser::parse_result yacco2:: Parser:: start_parallel_parsing(yacco2::State&S){ yacco2::State*Goto_state; /*412:*/ //#line 3349 "/usr/local/yacco2/library/parser.w" yacco2::USINT id_of_T= current_token__->enumerated_id__; /*:412*/ //#line 3457 "/usr/local/yacco2/library/parser.w" /*378:*/ //#line 2820 "/usr/local/yacco2/library/parser.w" th_lst__.clear(); find_threads_by_first_set(id_of_T,th_lst__,*S.state_s_thread_tbl__); /*:378*/ //#line 3458 "/usr/local/yacco2/library/parser.w" /*379:*/ //#line 2825 "/usr/local/yacco2/library/parser.w" if(th_lst__.empty()==YES)return Parser::no_thds_to_run; /*:379*/ //#line 3459 "/usr/local/yacco2/library/parser.w" /*413:*/ //#line 3354 "/usr/local/yacco2/library/parser.w" bool how_thread_called= start_threads(); /*:413*/ //#line 3460 "/usr/local/yacco2/library/parser.w" wait_for_response: /*407:*/ //#line 3321 "/usr/local/yacco2/library/parser.w" if(how_thread_called==CALLED_AS_THREAD){ wait_for_event(); } /*:407*/ //#line 3462 "/usr/local/yacco2/library/parser.w" /*594:*/ //#line 636 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ if(no_requested_ths_to_run__> 1){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::" <<"parallel parsing received message from id:" <thread_no__<<"::" <thread_name() <set_symbol(NS_yacco2_k_symbols::PTR_LR1_parallel_operator__); Goto_state= S.parallel_shift__->goto__; /*349:*/ //#line 2379 "/usr/local/yacco2/library/parser.w" /*132:*/ //#line 226 "/usr/local/yacco2/library/parse_env.w" if(parse_stack__.top_sub__>=MAX_LR_STK_ITEMS){ char a[BUFFER_SIZE]; yacco2::KCHARP msg= "lr_stk - push overflow stack max: %i"; sprintf(a,msg,MAX_LR_STK_ITEMS); Yacco2_faulty_precondition(a,__FILE__,__LINE__); exit(1); } ++parse_stack__.top__; ++parse_stack__.top_sub__; parse_stack__.top__->state__= Goto_state; parse_stack__.top__->symbol__= 0; parse_stack__.top__->aborted__= 0; parse_stack__.top__->rule_s_reuse_entry_ptr__= 0; /*:132*/ //#line 2380 "/usr/local/yacco2/library/parser.w" /*:349*/ //#line 3446 "/usr/local/yacco2/library/parser.w" /*:420*/ //#line 3466 "/usr/local/yacco2/library/parser.w" if(S.state_s_thread_tbl__->ar_fnct_ptr__==0){ arbitrated_token__= &pp_accept_queue__[1]; pp_accept_queue_idx__= 1; }else{ call_arbitrator(S.state_s_thread_tbl__->ar_fnct_ptr__); } /*411:*/ //#line 3344 "/usr/local/yacco2/library/parser.w" override_current_token(*arbitrated_token__->accept_token__ ,arbitrated_token__->accept_token_pos__); /*:411*/ //#line 3474 "/usr/local/yacco2/library/parser.w" /*592:*/ //#line 574 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<accept_token_pos__ <<" token*: "<accept_token__<<" token: " <accept_token__->id__<accept_token__) yacco2::lrclog <<" GPS LINE: " <accept_token__->tok_co_ords__.line_no__ <<" GPS CHR POS: " <accept_token__->tok_co_ords__.pos_in_line__ <la_token_pos__<<" la token: " <la_token__->id__<la_token__) yacco2::lrclog <<" GPS LA LINE: " <la_token__->tok_co_ords__.line_no__ <<" GPS LA CHR POS: " <la_token__->tok_co_ords__.pos_in_line__ <accept_token__); /*410:*/ //#line 3340 "/usr/local/yacco2/library/parser.w" override_current_token(*arbitrated_token__->la_token__,arbitrated_token__->la_token_pos__); /*:410*/ //#line 3477 "/usr/local/yacco2/library/parser.w" /*593:*/ //#line 612 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__ <tok_co_ords__.line_no__ <<" GPS RE-ALIGN CHR POS: " <tok_co_ords__.pos_in_line__ <accept_token__= 0; /*:408*/ //#line 3479 "/usr/local/yacco2/library/parser.w" clean_up(); return Parser::paralleled; parallelism_unsuccessful: /*405:*/ //#line 3299 "/usr/local/yacco2/library/parser.w" clean_up(); return Parser::erred; /*:405*/ //#line 3483 "/usr/local/yacco2/library/parser.w" } /*:421*//*422:*/ //#line 3500 "/usr/local/yacco2/library/parser.w" Parser::parse_result yacco2:: Parser:: start_manually_parallel_parsing (yacco2::USINT Thread_id){ bool how_thread_called= spawn_thread_manually(Thread_id); /*407:*/ //#line 3321 "/usr/local/yacco2/library/parser.w" if(how_thread_called==CALLED_AS_THREAD){ wait_for_event(); } /*:407*/ //#line 3507 "/usr/local/yacco2/library/parser.w" /*594:*/ //#line 636 "/usr/local/yacco2/library/macros.w" if(YACCO2_TH__){ if(no_requested_ths_to_run__> 1){ bool to_trace_or_not_to= trace_parser_env(this,COND_STK_TRACE); if(to_trace_or_not_to==YES){ /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<id__<<"::" <<"parallel parsing received message from id:" <thread_no__<<"::" <thread_name() <accept_token_pos__ <<" token*: "<accept_token__<<" token: " <accept_token__->id__<accept_token__) yacco2::lrclog <<" GPS LINE: " <accept_token__->tok_co_ords__.line_no__ <<" GPS CHR POS: " <accept_token__->tok_co_ords__.pos_in_line__ <la_token_pos__<<" la token: " <la_token__->id__<la_token__) yacco2::lrclog <<" GPS LA LINE: " <la_token__->tok_co_ords__.line_no__ <<" GPS LA CHR POS: " <la_token__->tok_co_ords__.pos_in_line__ < yacco2::O2_LOGICALS__; yacco2::gbl_file_map_type yacco2::FILE_TBL__; std::vector yacco2::STK_FILE_NOS__; yacco2::UINT yacco2::FILE_CNT__(0); yacco2::rc_map yacco2::RC__; yacco2::Type_pp_fnct_ptr yacco2::PTR_AR_for_manual_thread_spawning(0); yacco2::KCHARP yacco2::Lr1_VERSION= "O2 version: 1.0 Distribution Date: " __DATE__"\n"; yacco2::KCHARP yacco2::O2linker_VERSION= "O2linker version: 1.0 Distribution Date: " __DATE__"\n"; yacco2::MUTEX yacco2::TOKEN_MU; yacco2::MUTEX yacco2::TRACE_MU; yacco2::MUTEX yacco2::TH_TBL_MU; yacco2::MUTEX yacco2::SYM_TBL_MU; std::ofstream yacco2::lrclog("1lrtracings.log"); std::ofstream yacco2::lrerrors("1lrerrors.log"); yacco2::Set_entry yacco2::LRK_LA_EOLR_SET = {0,0xf4}; yacco2::Set_entry yacco2::LRK_LA_QUE_SET = {0,0x01}; /*:428*//*430:*/ //#line 139 "/usr/local/yacco2/library/runtime_env.w" yacco2:: Source_info:: Source_info(yacco2::KCHARP File,yacco2::UINT Line) :file__(File) ,line__(Line){ w_info(); } void yacco2:: Source_info:: w_info(){ yacco2::lrclog <<" Version: "<fsm_tbl__==0){ yacco2::KCHARP msg= "Error - parser's finite state table is zero ptr"; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:550*/ //#line 1318 "/usr/local/yacco2/library/macros.w" /*551:*/ //#line 92 "/usr/local/yacco2/library/constraints.w" if(parser->parse_stack__.top_sub__<1){ yacco2::KCHARP msg= "Error - parser's stack is empty"; Yacco2_faulty_precondition(msg,__FILE__,__LINE__); exit(1); } /*:551*/ //#line 1319 "/usr/local/yacco2/library/macros.w" /*635:*/ //#line 1306 "/usr/local/yacco2/library/macros.w" if(Trace_type==COND_STK_TRACE){ if(parser->fsm_tbl__->debug__==OFF)return NO; } /*:635*/ //#line 1320 "/usr/local/yacco2/library/macros.w" /*633:*/ //#line 1277 "/usr/local/yacco2/library/macros.w" /*389:*/ //#line 3053 "/usr/local/yacco2/library/parser.w" LOCK_MUTEX(yacco2::TRACE_MU); if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Acquired trace mu"<parse_stack__.top_sub__;++x)yacco2::lrclog<<"."; yacco2::lrclog<thread_no__; yacco2::lrclog<<"::"; yacco2::lrclog<fsm_tbl__->id__<<"::"; /*390:*/ //#line 3060 "/usr/local/yacco2/library/parser.w" if(yacco2::YACCO2_MU_TRACING__){ yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<parse_stack__.first_sf__; Cparse_record*ie= parser->parse_stack__.top__; for(int xxx(1);i!=ie;i= parser->parse_stack__.sf_by_sub(++xxx)){ yacco2::lrclog<state__->state_no__<<"--"; CAbs_lr1_sym*sym= i->symbol__; if(sym)yacco2::lrclog<id__<<"-> "; else yacco2::lrclog<<"ZEROED OUT SYMBOL"<<"-> "; } yacco2::lrclog<state__->state_no__; yacco2::lrclog<