/*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<<R;
//#line 1 "/usr/local/yacco2/library/tblkup.w"







/*:50*/
//#line 154 "/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
,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)
{
tok_co_ords__.rc_pos__= 0;
tok_co_ords__.line_no__= 0;
tok_co_ords__.external_file_id__= 0;
tok_co_ords__.pos_in_line__= 0;
tok_co_ords__.who_file__= 0;
tok_co_ords__.who_line_no__= 0;
/*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<<R;
//#line 1 "/usr/local/yacco2/library/tblkup.w"







/*:50*/
//#line 177 "/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
,bool Auto_delete
,bool Affected_by_abort
,yacco2::USINT Ext_file_no
,yacco2::UINT Rc_pos)
:id__(Id)
,dtor__(Dtor)
,enumerated_id__(Enum_id)
,auto_delete__(Auto_delete)
,affected_by_abort__(Affected_by_abort)
{
tok_co_ords__.rc_pos__= Rc_pos;
tok_co_ords__.line_no__= 0;
tok_co_ords__.external_file_id__= Ext_file_no;
tok_co_ords__.pos_in_line__= 0;
tok_co_ords__.who_file__= 0;
tok_co_ords__.who_line_no__= 0;
/*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<<R;
//#line 1 "/usr/local/yacco2/library/tblkup.w"







/*:50*/
//#line 202 "/usr/local/yacco2/library/CAbs_lr1_sym.w"

}

/*:60*//*61:*/
//#line 207 "/usr/local/yacco2/library/CAbs_lr1_sym.w"

yacco2::UCHAR yacco2::CAbs_lr1_sym::enum_id_set_partition_no()const{
return tok_co_ords__.set_entry__.partition__;
}

yacco2::UCHAR yacco2::CAbs_lr1_sym::enum_id_set_member()const{
return tok_co_ords__.set_entry__.elements__;
}

/*:61*//*62:*/
//#line 217 "/usr/local/yacco2/library/CAbs_lr1_sym.w"

yacco2::USINT
yacco2::
CAbs_lr1_sym::
rhs_no_of_parms(){
return rule_info__.rhs_no_of_parms__;
}

/*:62*//*63:*/
//#line 229 "/usr/local/yacco2/library/CAbs_lr1_sym.w"

yacco2::
Parser*
yacco2::
CAbs_lr1_sym::
parser(){
return rule_info__.parser__;
}

/*:63*//*64:*/
//#line 242 "/usr/local/yacco2/library/CAbs_lr1_sym.w"

yacco2::KCHARP
yacco2::
CAbs_lr1_sym::
id()const{
return id__;
}

/*:64*//*65:*/
//#line 256 "/usr/local/yacco2/library/CAbs_lr1_sym.w"

yacco2::USINT
yacco2::
CAbs_lr1_sym::
enumerated_id()const{
return enumerated_id__;
}

/*:65*//*66:*/
//#line 265 "/usr/local/yacco2/library/CAbs_lr1_sym.w"

void yacco2::
CAbs_lr1_sym::
set_enumerated_id(yacco2::USINT Id){
enumerated_id__= Id;
}
/*:66*//*67:*/
//#line 274 "/usr/local/yacco2/library/CAbs_lr1_sym.w"

void
yacco2::
CAbs_lr1_sym::
set_affected_by_abort(bool X){
affected_by_abort__= X;
}

bool
yacco2::
CAbs_lr1_sym::
affected_by_abort()const{
return affected_by_abort__;
}
/*:67*//*68:*/
//#line 291 "/usr/local/yacco2/library/CAbs_lr1_sym.w"

void
yacco2::
CAbs_lr1_sym::
set_auto_delete(bool X){
auto_delete__= X;
}

bool
yacco2::
CAbs_lr1_sym::
auto_delete()const{
return auto_delete__;
}
/*:68*//*69:*/
//#line 313 "/usr/local/yacco2/library/CAbs_lr1_sym.w"

yacco2::FN_DTOR
yacco2::
CAbs_lr1_sym::
dtor(){
return dtor__;
}

/*:69*//*70:*/
//#line 352 "/usr/local/yacco2/library/CAbs_lr1_sym.w"

void
yacco2::
CAbs_lr1_sym::
set_rc(yacco2::CAbs_lr1_sym&Rc,yacco2::KCHARP GPS_FILE,yacco2::UINT GPS_LINE){
if(GPS_FILE!=0){
tok_co_ords__.who_file__= GPS_FILE;
tok_co_ords__.who_line_no__= GPS_LINE;
}
if(Rc.tok_co_ords__.external_file_id__> 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;x<pp_accept_queue_size;++x){
pp_accept_queue__[x].initialize_it();
}
if(token_supplier__!=0){
supplier_r_w_cnt__= token_supplier__->r_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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 285 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<"YACCO2_T__::"
<<thread_no__<<"::"<<thread_name()<<"::"
<<" enum: "<<current_token__->enumerated_id__
<<' '<<'"'<<current_token__->id__<<'"'
<<" pos: "<<current_token_pos__<<FILE_LINE<<std::endl;
yacco2::lrclog
<<"\t\t::GPS FILE: ";


EXTERNAL_GPSing(current_token__)
yacco2::lrclog
<<" GPS LINE: "
<<current_token__->tok_co_ords__.line_no__
<<" GPS CHR POS: "
<<current_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE
<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 303 "/usr/local/yacco2/library/parser.w"

}
}

/*:230*//*232:*/
//#line 336 "/usr/local/yacco2/library/parser.w"

yacco2::
Parser::
Parser(yacco2::CAbs_fsm&Fsm_tbl
,yacco2::Thread_entry&Thread_entry
,yacco2::Parser*Calling_parser)
:fsm_tbl__(&Fsm_tbl)
,thread_name__(Thread_entry.thread_fnct_name__)
,thread_entry__(&Thread_entry)
,token_supplier__(0)
,token_producer__(0)
,current_token__(0)
,current_token_pos__(0)
,start_token__(0)
,start_token_pos__(0)
,recycle_bin__(0)
,sym_lookup_functor__(0)
,abort_parse__(OFF)
,stop_parse__(OFF)
,use_all_shift__(YES)
,has_questionable_shift_occured__(OFF)
,from_thread__(0)
,thread_no__(THREAD_SELF())
,cv_cond__(EVENT_RECEIVED)
,th_blk__(this,Calling_parser)
,pp_accept_queue__()
,pp_accept_queue_idx__(0)
,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__(0)
{
CREATE_COND_VAR(cv__);
CREATE_MUTEX(mu__);
LOCK_MUTEX_OF_CALLED_PARSER(mu__,*this," of self");
fsm_tbl__->parser(*this);
Fsm_tbl.parser(*this);
parse_stack__.lr_stk_init(*fsm_tbl__->start_state__);
for(int x= 0;x<pp_accept_queue_size;++x){
pp_accept_queue__[x].initialize_it();
}
}
/*:232*//*233:*/
//#line 387 "/usr/local/yacco2/library/parser.w"

yacco2::
Parser::
Parser(yacco2::CAbs_fsm&Fsm_tbl
,yacco2::Parser*Calling_parser)
:fsm_tbl__(&Fsm_tbl)
,thread_name__(Fsm_tbl.id__)
,thread_entry__(0)
,token_supplier__(0)
,token_producer__(0)
,current_token__(0)
,current_token_pos__(0)
,start_token__(0)
,start_token_pos__(0)
,recycle_bin__(0)
,sym_lookup_functor__(0)
,abort_parse__(OFF)
,stop_parse__(OFF)
,use_all_shift__(YES)
,has_questionable_shift_occured__(OFF)
,from_thread__(0)
,thread_no__(THREAD_SELF())
,cv_cond__(EVENT_RECEIVED)
,th_blk__()
,pp_accept_queue__()
,pp_accept_queue_idx__(0)
,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__(true)
,supplier_r_w_cnt__(0)
{
CREATE_COND_VAR(cv__);
CREATE_MUTEX(mu__);
LOCK_MUTEX_OF_CALLED_PARSER(mu__,*this," of self");
fsm_tbl__->parser(*this);
Fsm_tbl.parser(*this);
parse_stack__.lr_stk_init(*fsm_tbl__->start_state__);
for(int x= 0;x<pp_accept_queue_size;++x){
pp_accept_queue__[x].initialize_it();
}
}

/*:233*//*234:*/
//#line 438 "/usr/local/yacco2/library/parser.w"


yacco2::
Parser::
~Parser(){
clear_parse_stack();
DESTROY_COND_VAR(cv__);
DESTROY_MUTEX(mu__);
}

/*:234*//*236:*/
//#line 450 "/usr/local/yacco2/library/parser.w"

void
yacco2::
Parser::
shift(yacco2::Shift_entry&SE){
/*352:*/
//#line 2415 "/usr/local/yacco2/library/parser.w"

Cparse_record*pr= parse_stack__.top__;

/*:352*/
//#line 455 "/usr/local/yacco2/library/parser.w"

/*242:*/
//#line 524 "/usr/local/yacco2/library/parser.w"

pr->symbol__= 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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 486 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_TH__::"<<thread_no__<<"::"
<<fsm_tbl__->id__
<<"::############# TRY STRAIGHT try_straight_due_to_aborted_parallel"
<<" reset token pos: "<<current_token_pos__
<<" reset token: "
<<current_token__->id__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS RESET FILE: ";
EXTERNAL_GPSing(current_token())
yacco2::lrclog
<<" GPS RESET LINE: "
<<current_token()->tok_co_ords__.line_no__
<<" GPS RESET CHR POS: "
<<current_token()->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 503 "/usr/local/yacco2/library/macros.w"

}
}
/*:588*/
//#line 750 "/usr/local/yacco2/library/parser.w"

/*353:*/
//#line 2419 "/usr/local/yacco2/library/parser.w"

pr= parse_stack__.top__;

/*:353*/
//#line 751 "/usr/local/yacco2/library/parser.w"

goto straight_parsing;

/*:258*/
//#line 639 "/usr/local/yacco2/library/parser.w"

proc_call_parsing:
{
/*259:*/
//#line 757 "/usr/local/yacco2/library/parser.w"

THR_result rslt= chained_proc_call_parsing(*cur_state);

switch(rslt){
case erred:goto straight_parsing;
case no_thds_to_run:goto straight_parsing;
default:{
result= paralleled;
break;
}
}


/*:259*/
//#line 642 "/usr/local/yacco2/library/parser.w"

/*260:*/
//#line 771 "/usr/local/yacco2/library/parser.w"

if(result==paralleled){
/*261:*/
//#line 779 "/usr/local/yacco2/library/parser.w"

Reduce_entry*re(0);
if(parse_stack__.top__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 511 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_TH__::"<<thread_no__<<"::"
<<fsm_tbl__->id__
<<"::############# TRY STRAIGHT try_straight_due_to_aborted_parallel"
<<" reset token pos: "
<<current_token_pos__<<" reset token: "
<<current_token__->id__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS RESET FILE: ";
EXTERNAL_GPSing(current_token())
yacco2::lrclog
<<" GPS RESET LINE: "
<<current_token()->tok_co_ords__.line_no__
<<" GPS RESET CHR POS: "
<<current_token()->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 528 "/usr/local/yacco2/library/macros.w"

}
}

/*:589*/
//#line 787 "/usr/local/yacco2/library/parser.w"

/*353:*/
//#line 2419 "/usr/local/yacco2/library/parser.w"

pr= parse_stack__.top__;

/*:353*/
//#line 788 "/usr/local/yacco2/library/parser.w"

goto straight_parsing;


/*:262*/
//#line 644 "/usr/local/yacco2/library/parser.w"

}
straight_parsing:
/*237:*/
//#line 464 "/usr/local/yacco2/library/parser.w"

yacco2::Shift_entry*se(0);
if(pr->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 539 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::"<<fsm_tbl__->id__<<"::";
yacco2::lrclog<<"#############straight parse-error current token "
<<'"'<<current_token()->id__
<<'"'<<" pos: "<<current_token_pos__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS RESET FILE: ";
EXTERNAL_GPSing(current_token())
yacco2::lrclog
<<" GPS RESET LINE: "
<<current_token()->tok_co_ords__.line_no__
<<" GPS RESET CHR POS: "
<<current_token()->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 555 "/usr/local/yacco2/library/macros.w"

}
}

/*:590*/
//#line 616 "/usr/local/yacco2/library/parser.w"

cleanup_stack_due_to_abort();
return Parser::erred;
}

/*:249*//*265:*/
//#line 843 "/usr/local/yacco2/library/parser.w"

void
yacco2::
Parser::
parallel_shift(yacco2::CAbs_lr1_sym&Accept_terminal){
/*352:*/
//#line 2415 "/usr/local/yacco2/library/parser.w"

Cparse_record*pr= parse_stack__.top__;

/*:352*/
//#line 848 "/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__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 486 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_TH__::"<<thread_no__<<"::"
<<fsm_tbl__->id__
<<"::############# TRY STRAIGHT try_straight_due_to_aborted_parallel"
<<" reset token pos: "<<current_token_pos__
<<" reset token: "
<<current_token__->id__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS RESET FILE: ";
EXTERNAL_GPSing(current_token())
yacco2::lrclog
<<" GPS RESET LINE: "
<<current_token()->tok_co_ords__.line_no__
<<" GPS RESET CHR POS: "
<<current_token()->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 503 "/usr/local/yacco2/library/macros.w"

}
}
/*:588*/
//#line 750 "/usr/local/yacco2/library/parser.w"

/*353:*/
//#line 2419 "/usr/local/yacco2/library/parser.w"

pr= parse_stack__.top__;

/*:353*/
//#line 751 "/usr/local/yacco2/library/parser.w"

goto straight_parsing;

/*:258*/
//#line 959 "/usr/local/yacco2/library/parser.w"

proc_call_parsing:
{
/*259:*/
//#line 757 "/usr/local/yacco2/library/parser.w"

THR_result rslt= chained_proc_call_parsing(*cur_state);

switch(rslt){
case erred:goto straight_parsing;
case no_thds_to_run:goto straight_parsing;
default:{
result= paralleled;
break;
}
}


/*:259*/
//#line 962 "/usr/local/yacco2/library/parser.w"

/*260:*/
//#line 771 "/usr/local/yacco2/library/parser.w"

if(result==paralleled){
/*261:*/
//#line 779 "/usr/local/yacco2/library/parser.w"

Reduce_entry*re(0);
if(parse_stack__.top__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 511 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_TH__::"<<thread_no__<<"::"
<<fsm_tbl__->id__
<<"::############# TRY STRAIGHT try_straight_due_to_aborted_parallel"
<<" reset token pos: "
<<current_token_pos__<<" reset token: "
<<current_token__->id__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS RESET FILE: ";
EXTERNAL_GPSing(current_token())
yacco2::lrclog
<<" GPS RESET LINE: "
<<current_token()->tok_co_ords__.line_no__
<<" GPS RESET CHR POS: "
<<current_token()->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 528 "/usr/local/yacco2/library/macros.w"

}
}

/*:589*/
//#line 787 "/usr/local/yacco2/library/parser.w"

/*353:*/
//#line 2419 "/usr/local/yacco2/library/parser.w"

pr= parse_stack__.top__;

/*:353*/
//#line 788 "/usr/local/yacco2/library/parser.w"

goto straight_parsing;


/*:262*/
//#line 964 "/usr/local/yacco2/library/parser.w"

}

straight_parsing:
/*237:*/
//#line 464 "/usr/local/yacco2/library/parser.w"

yacco2::Shift_entry*se(0);
if(pr->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 659 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_TH__::"<<thread_no__<<"::";
yacco2::lrclog<<fsm_tbl__->id__<<"::";
yacco2::lrclog<<"accept-parallel-parse current token "
<<'"'<<current_token()->id__<<'"'
<<" pos: "<<current_token_pos__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"YACCO2_TH__::"<<" accept tok: "
<<pp_rsvp__.accept_token__->id__<<" tok pos: "
<<pp_rsvp__.accept_token_pos__
<<" la tok: "<<pp_rsvp__.la_token__->id__
<<" la tok pos: "
<<pp_rsvp__.la_token_pos__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<" thru fsm-> parser*: "
<<fsm_tbl__->parser()<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS ACCEPT FILE: ";
EXTERNAL_GPSing(pp_rsvp__.accept_token__)
yacco2::lrclog
<<" GPS ACCEPT  LINE: "
<<pp_rsvp__.accept_token__->tok_co_ords__.line_no__
<<" GPS ACCEPT  CHR POS: "
<<pp_rsvp__.accept_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS ACCEPT LA FILE: ";
EXTERNAL_GPSing(pp_rsvp__.la_token__)
yacco2::lrclog
<<" GPS ACCEPT  LA LINE: "
<<pp_rsvp__.la_token__->tok_co_ords__.line_no__
<<" GPS ACCEPT LA CHR POS: "
<<pp_rsvp__.la_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 693 "/usr/local/yacco2/library/macros.w"

}
}
}

/*:595*/
//#line 1002 "/usr/local/yacco2/library/parser.w"

if(launched_as_procedure__==true){
/*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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 758 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__<<"::";
yacco2::lrclog<<fsm_tbl__->id__<<"::";
yacco2::lrclog<<" called thread reducing thread active count of caller thread "
<<pp_requesting_parallelism__->thread_no__<<"::"
<<pp_requesting_parallelism__->fsm_tbl__->id__
<<" active thread count::"<<pp_requesting_parallelism__->th_active_cnt__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 766 "/usr/local/yacco2/library/macros.w"

}

/*:598*/
//#line 1090 "/usr/local/yacco2/library/parser.w"

--pp_requesting_parallelism__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 772 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__<<"::";
yacco2::lrclog<<fsm_tbl__->id__<<"::";
yacco2::lrclog<<" called thread after reducing thread active count of caller thread "
<<pp_requesting_parallelism__->thread_no__<<"::"
<<pp_requesting_parallelism__->fsm_tbl__->id__
<<" active thread count::"<<pp_requesting_parallelism__->th_active_cnt__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 780 "/usr/local/yacco2/library/macros.w"

}


/*:599*/
//#line 1101 "/usr/local/yacco2/library/parser.w"


/*:280*/
//#line 1004 "/usr/local/yacco2/library/parser.w"

/*278:*/
//#line 1057 "/usr/local/yacco2/library/parser.w"

pp_requesting_parallelism__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2831 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Attempting to acquire thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2833 "/usr/local/yacco2/library/parser.w"

}
LOCK_MUTEX(yacco2::TH_TBL_MU);
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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2837 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Acquired thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2839 "/usr/local/yacco2/library/parser.w"

}

/*:380*/
//#line 1023 "/usr/local/yacco2/library/parser.w"

th_blk__.set_waiting_for_work();
/*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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2845 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Attempting to release thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2847 "/usr/local/yacco2/library/parser.w"

}
UNLOCK_MUTEX(yacco2::TH_TBL_MU);
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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2851 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Released thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2853 "/usr/local/yacco2/library/parser.w"

}

/*:381*/
//#line 1025 "/usr/local/yacco2/library/parser.w"


/*:273*/
//#line 1010 "/usr/local/yacco2/library/parser.w"

/*275:*/
//#line 1035 "/usr/local/yacco2/library/parser.w"

LOCK_MUTEX_OF_CALLED_PARSER(pp_requesting_parallelism__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 758 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__<<"::";
yacco2::lrclog<<fsm_tbl__->id__<<"::";
yacco2::lrclog<<" called thread reducing thread active count of caller thread "
<<pp_requesting_parallelism__->thread_no__<<"::"
<<pp_requesting_parallelism__->fsm_tbl__->id__
<<" active thread count::"<<pp_requesting_parallelism__->th_active_cnt__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 766 "/usr/local/yacco2/library/macros.w"

}

/*:598*/
//#line 1090 "/usr/local/yacco2/library/parser.w"

--pp_requesting_parallelism__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 772 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__<<"::";
yacco2::lrclog<<fsm_tbl__->id__<<"::";
yacco2::lrclog<<" called thread after reducing thread active count of caller thread "
<<pp_requesting_parallelism__->thread_no__<<"::"
<<pp_requesting_parallelism__->fsm_tbl__->id__
<<" active thread count::"<<pp_requesting_parallelism__->th_active_cnt__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 780 "/usr/local/yacco2/library/macros.w"

}


/*:599*/
//#line 1101 "/usr/local/yacco2/library/parser.w"


/*:280*/
//#line 1012 "/usr/local/yacco2/library/parser.w"

/*278:*/
//#line 1057 "/usr/local/yacco2/library/parser.w"

pp_requesting_parallelism__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 1105 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__
<<"::"<<thread_name()<<" all threads reported back "
<<" Caller parser::"<<pp_requesting_parallelism__->thread_no__
<<"::"<<pp_requesting_parallelism__->thread_name()
<<" # competing thds: "
<<pp_requesting_parallelism__->no_requested_ths_to_run__
<<" # active thds: "
<<pp_requesting_parallelism__->th_active_cnt__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 1115 "/usr/local/yacco2/library/macros.w"

}

/*:621*/
//#line 1050 "/usr/local/yacco2/library/parser.w"

post_event_to_requesting_grammar(*pp_requesting_parallelism__,Accept_parallel_parse,*this);
}else{
/*622:*/
//#line 1119 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 1121 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__
<<"::"<<thread_name()<<" NOT all threads reported back "
<<" Caller parser::"<<pp_requesting_parallelism__->thread_no__
<<"::"<<pp_requesting_parallelism__->thread_name()
<<" # competing thds: "
<<pp_requesting_parallelism__->no_requested_ths_to_run__
<<" # active thds: "<<pp_requesting_parallelism__->th_active_cnt__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 1130 "/usr/local/yacco2/library/macros.w"

}

/*:622*/
//#line 1053 "/usr/local/yacco2/library/parser.w"

}

/*:277*/
//#line 1029 "/usr/local/yacco2/library/parser.w"



/*:274*/
//#line 1015 "/usr/local/yacco2/library/parser.w"

/*276:*/
//#line 1044 "/usr/local/yacco2/library/parser.w"

UNLOCK_MUTEX_OF_CALLED_PARSER(pp_requesting_parallelism__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 704 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_TH__::"<<thread_no__<<"::";
yacco2::lrclog<<fsm_tbl__->id__<<"::";
yacco2::lrclog<<"YACCO2_TH__::"
<<"#############parallel parse-error current token "
<<current_token()->id__<<" pos: "<<current_token_pos__
<<" enum id: "<<current_token()->enumerated_id__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS RESET FILE: ";
EXTERNAL_GPSing(current_token())
yacco2::lrclog
<<" GPS RESET LINE: "
<<current_token()->tok_co_ords__.line_no__
<<" GPS RESET CHR POS: "
<<current_token()->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 721 "/usr/local/yacco2/library/macros.w"

}
}
}

/*:596*/
//#line 1071 "/usr/local/yacco2/library/parser.w"

if(launched_as_procedure__==true){
/*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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 758 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__<<"::";
yacco2::lrclog<<fsm_tbl__->id__<<"::";
yacco2::lrclog<<" called thread reducing thread active count of caller thread "
<<pp_requesting_parallelism__->thread_no__<<"::"
<<pp_requesting_parallelism__->fsm_tbl__->id__
<<" active thread count::"<<pp_requesting_parallelism__->th_active_cnt__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 766 "/usr/local/yacco2/library/macros.w"

}

/*:598*/
//#line 1090 "/usr/local/yacco2/library/parser.w"

--pp_requesting_parallelism__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 772 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__<<"::";
yacco2::lrclog<<fsm_tbl__->id__<<"::";
yacco2::lrclog<<" called thread after reducing thread active count of caller thread "
<<pp_requesting_parallelism__->thread_no__<<"::"
<<pp_requesting_parallelism__->fsm_tbl__->id__
<<" active thread count::"<<pp_requesting_parallelism__->th_active_cnt__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 780 "/usr/local/yacco2/library/macros.w"

}


/*:599*/
//#line 1101 "/usr/local/yacco2/library/parser.w"


/*:280*/
//#line 1073 "/usr/local/yacco2/library/parser.w"

goto fire_off_error_functor;
}
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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2831 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Attempting to acquire thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2833 "/usr/local/yacco2/library/parser.w"

}
LOCK_MUTEX(yacco2::TH_TBL_MU);
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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2837 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Acquired thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2839 "/usr/local/yacco2/library/parser.w"

}

/*:380*/
//#line 1023 "/usr/local/yacco2/library/parser.w"

th_blk__.set_waiting_for_work();
/*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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2845 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Attempting to release thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2847 "/usr/local/yacco2/library/parser.w"

}
UNLOCK_MUTEX(yacco2::TH_TBL_MU);
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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2851 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Released thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2853 "/usr/local/yacco2/library/parser.w"

}

/*:381*/
//#line 1025 "/usr/local/yacco2/library/parser.w"


/*:273*/
//#line 1077 "/usr/local/yacco2/library/parser.w"

/*275:*/
//#line 1035 "/usr/local/yacco2/library/parser.w"

LOCK_MUTEX_OF_CALLED_PARSER(pp_requesting_parallelism__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 758 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__<<"::";
yacco2::lrclog<<fsm_tbl__->id__<<"::";
yacco2::lrclog<<" called thread reducing thread active count of caller thread "
<<pp_requesting_parallelism__->thread_no__<<"::"
<<pp_requesting_parallelism__->fsm_tbl__->id__
<<" active thread count::"<<pp_requesting_parallelism__->th_active_cnt__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 766 "/usr/local/yacco2/library/macros.w"

}

/*:598*/
//#line 1090 "/usr/local/yacco2/library/parser.w"

--pp_requesting_parallelism__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 772 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__<<"::";
yacco2::lrclog<<fsm_tbl__->id__<<"::";
yacco2::lrclog<<" called thread after reducing thread active count of caller thread "
<<pp_requesting_parallelism__->thread_no__<<"::"
<<pp_requesting_parallelism__->fsm_tbl__->id__
<<" active thread count::"<<pp_requesting_parallelism__->th_active_cnt__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 780 "/usr/local/yacco2/library/macros.w"

}


/*:599*/
//#line 1101 "/usr/local/yacco2/library/parser.w"


/*:280*/
//#line 1079 "/usr/local/yacco2/library/parser.w"

/*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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 1105 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__
<<"::"<<thread_name()<<" all threads reported back "
<<" Caller parser::"<<pp_requesting_parallelism__->thread_no__
<<"::"<<pp_requesting_parallelism__->thread_name()
<<" # competing thds: "
<<pp_requesting_parallelism__->no_requested_ths_to_run__
<<" # active thds: "
<<pp_requesting_parallelism__->th_active_cnt__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 1115 "/usr/local/yacco2/library/macros.w"

}

/*:621*/
//#line 1050 "/usr/local/yacco2/library/parser.w"

post_event_to_requesting_grammar(*pp_requesting_parallelism__,Accept_parallel_parse,*this);
}else{
/*622:*/
//#line 1119 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 1121 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__
<<"::"<<thread_name()<<" NOT all threads reported back "
<<" Caller parser::"<<pp_requesting_parallelism__->thread_no__
<<"::"<<pp_requesting_parallelism__->thread_name()
<<" # competing thds: "
<<pp_requesting_parallelism__->no_requested_ths_to_run__
<<" # active thds: "<<pp_requesting_parallelism__->th_active_cnt__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 1130 "/usr/local/yacco2/library/macros.w"

}

/*:622*/
//#line 1053 "/usr/local/yacco2/library/parser.w"

}

/*:277*/
//#line 1029 "/usr/local/yacco2/library/parser.w"



/*:274*/
//#line 1080 "/usr/local/yacco2/library/parser.w"

/*276:*/
//#line 1044 "/usr/local/yacco2/library/parser.w"

UNLOCK_MUTEX_OF_CALLED_PARSER(pp_requesting_parallelism__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 659 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_TH__::"<<thread_no__<<"::";
yacco2::lrclog<<fsm_tbl__->id__<<"::";
yacco2::lrclog<<"accept-parallel-parse current token "
<<'"'<<current_token()->id__<<'"'
<<" pos: "<<current_token_pos__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"YACCO2_TH__::"<<" accept tok: "
<<pp_rsvp__.accept_token__->id__<<" tok pos: "
<<pp_rsvp__.accept_token_pos__
<<" la tok: "<<pp_rsvp__.la_token__->id__
<<" la tok pos: "
<<pp_rsvp__.la_token_pos__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<" thru fsm-> parser*: "
<<fsm_tbl__->parser()<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS ACCEPT FILE: ";
EXTERNAL_GPSing(pp_rsvp__.accept_token__)
yacco2::lrclog
<<" GPS ACCEPT  LINE: "
<<pp_rsvp__.accept_token__->tok_co_ords__.line_no__
<<" GPS ACCEPT  CHR POS: "
<<pp_rsvp__.accept_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS ACCEPT LA FILE: ";
EXTERNAL_GPSing(pp_rsvp__.la_token__)
yacco2::lrclog
<<" GPS ACCEPT  LA LINE: "
<<pp_rsvp__.la_token__->tok_co_ords__.line_no__
<<" GPS ACCEPT LA CHR POS: "
<<pp_rsvp__.la_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 693 "/usr/local/yacco2/library/macros.w"

}
}
}

/*:595*/
//#line 1124 "/usr/local/yacco2/library/parser.w"

/*278:*/
//#line 1057 "/usr/local/yacco2/library/parser.w"

pp_requesting_parallelism__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 732 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_TH__::"<<thread_no__<<"::";
yacco2::lrclog<<fsm_tbl__->id__<<"::";
yacco2::lrclog<<"YACCO2_TH__::"
<<"#############parallel parse-error current token "
<<current_token()->id__<<" pos: "<<current_token_pos__
<<" enum id: "<<current_token()->enumerated_id__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS RESET FILE: ";
EXTERNAL_GPSing(current_token())
yacco2::lrclog
<<" GPS RESET LINE: "
<<current_token()->tok_co_ords__.line_no__
<<" GPS RESET CHR POS: "
<<current_token()->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 749 "/usr/local/yacco2/library/macros.w"

}
}
}

/*:597*/
//#line 1141 "/usr/local/yacco2/library/parser.w"

goto fire_off_error_functor;
fire_off_error_functor:
cleanup_stack_due_to_abort();
clean_up();
return Parser::erred;
}

/*:283*//*284:*/
//#line 1154 "/usr/local/yacco2/library/parser.w"

yacco2::Shift_entry*
yacco2::
Parser::
find_cur_T_shift_entry(){
/*352:*/
//#line 2415 "/usr/local/yacco2/library/parser.w"

Cparse_record*pr= parse_stack__.top__;

/*:352*/
//#line 1159 "/usr/local/yacco2/library/parser.w"

yacco2::USINT Enum_id= current_token__->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;x<cnt;++x){
k_entry= &(*shft_entry_array)[x];
if(Enum_id==k_entry->id__)return k_entry;
if(Enum_id<k_entry->id__)break;
}
eolr_seq:
for(int x= 0;x<cnt;++x){
k_entry= &(*shft_entry_array)[x];
if(LR1_Eolr==k_entry->id__)return k_entry;
if(LR1_Eolr<k_entry->id__)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<lower)goto eolr_srch;
seg_ln= upper+lower;
mid_pt= seg_ln>>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<lower)return 0;
seg_ln= upper+lower;
mid_pt= seg_ln>>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;++x){
if(x>=cnt)break;
k_entry= &(*shft_entry_array)[x];
if(Enum_id==k_entry->id__)return k_entry;
if(Enum_id<k_entry->id__)break;
}
eolr_seq:
for(int x= 0;x<cnt;++x){
if(x>=cnt)break;
k_entry= &(*shft_entry_array)[x];
if(LR1_Eolr==k_entry->id__)return k_entry;
if(LR1_Eolr<k_entry->id__)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<lower)goto eolr_srch;
seg_ln= upper+lower;
mid_pt= seg_ln>>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<lower)return 0;
seg_ln= upper+lower;
mid_pt= seg_ln>>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;x<no_set_pairs;++x){
k_entry= &(*set_entry_array)[x];
if(LRK_LA_QUE_SET.partition__==k_entry->partition__){
if(LRK_LA_QUE_SET.elements__&k_entry->elements__){
return re;
}else{
break;
}
}
if(LRK_LA_QUE_SET.partition__<k_entry->partition__)break;
}
continue;
QUE_srch:
lower= 1;
upper= no_set_pairs;
B2_que:
if(upper<lower)return 0;
seg_ln= upper+lower;
mid_pt= seg_ln>>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<lower)goto srch_end_cur_tok;
seg_ln= upper+lower;
mid_pt= seg_ln>>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;xx<no_set_pairs;++xx){
k_entry= &(*set_entry_array)[xx];
if(partition==k_entry->partition__){
if(element&k_entry->elements__){
return re;
}else{
break;
}
}
if(partition<k_entry->partition__)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<lower){
continue;
}
seg_ln= upper+lower;
mid_pt= seg_ln>>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;x<no_set_pairs;++x){
k_entry= &(*set_entry_array)[x];
if(LRK_LA_EOLR_SET.partition__==k_entry->partition__){
if(LRK_LA_EOLR_SET.elements__&k_entry->elements__){
return re;
}else{
break;
}
}
if(LRK_LA_EOLR_SET.partition__<k_entry->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__<pp_accept_queue_size){
pp_accept_queue__[th_accepting_cnt__].fill_it(Calling_parm);
}else{
abort_accept_queue_irregularites(Calling_parm);
}

}


/*:334*//*336:*/
//#line 2069 "/usr/local/yacco2/library/parser.w"

yacco2::CAbs_lr1_sym*
yacco2::Parser::
get_spec_stack_token(yacco2::UINT Pos){
if(Pos> 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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2150 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<"YACCO2_T__::"
<<thread_no__<<"::"<<thread_name()
<<" get_next_token:: pos to fetch: "<<current_token_pos__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2155 "/usr/local/yacco2/library/parser.w"

}

current_token__= (*token_supplier__)[current_token_pos__];

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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2161 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<"YACCO2_T__::"
<<thread_no__<<"::"<<thread_name()
<<" get_next_token:: pos: "<<current_token_pos__
<<"  enum: "<<current_token__->enumerated_id__<<' '
<<'"'<<current_token__->id__<<'"'<<" token fetched*: "
<<current_token__<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\t\t::GPS FILE: ";

EXTERNAL_GPSing(current_token__)
yacco2::lrclog
<<" GPS LINE: "
<<current_token__->tok_co_ords__.line_no__
<<" GPS CHR POS: "
<<current_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
EXTERNAL_GPSing(current_token__)
yacco2::lrclog
<<" GPS LINE: "
<<current_token__->tok_co_ords__.line_no__
<<" GPS CHR POS: "
<<current_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2188 "/usr/local/yacco2/library/parser.w"

}
Remap_token(current_token__)
if((YACCO2_T__!=0)&&(sym_lookup_functor__!=0)){
if(sym_lookup_functor__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2193 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<"YACCO2_T__::"
<<thread_no__<<"::"<<thread_name()
<<" get_next_token:: pos: "<<current_token_pos__
<<"  enum: "<<current_token__->enumerated_id__<<' '
<<" after remap "
<<'"'<<current_token__->id__<<'"'<<" token fetched*: "
<<current_token__<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\t\t::GPS FILE: ";
EXTERNAL_GPSing(current_token__)

yacco2::lrclog
<<" GPS LINE: "
<<current_token__->tok_co_ords__.line_no__
<<" GPS CHR POS: "
<<current_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2210 "/usr/local/yacco2/library/parser.w"

}
}
Remap_set_result_and_return(current_token__)
}

/*:337*//*338:*/
//#line 2217 "/usr/local/yacco2/library/parser.w"

yacco2::CAbs_lr1_sym*
yacco2::
Parser::
get_spec_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 2222 "/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 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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2226 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<"YACCO2_T__::"
<<thread_no__<<"::"<<thread_name()<<"::"
<<" get_spec_token pos: "
<<Pos<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2231 "/usr/local/yacco2/library/parser.w"

}
CAbs_lr1_sym*token= (*token_supplier__)[Pos];
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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2235 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<"YACCO2_T__::"
<<thread_no__<<"::"<<thread_name()<<"::"
<<" get_spec_token: returned token "<<token->id__<<" pos: "
<<Pos
<<" enum: "<<token->enumerated_id__
<<'"'<<token->id__<<'"'
<<FILE_LINE<<std::endl;
yacco2::lrclog
<<"\t\t::GPS FILE: ";

EXTERNAL_GPSing(token)
yacco2::lrclog
<<" GPS LINE: "
<<token->tok_co_ords__.line_no__
<<" GPS CHR POS: "
<<token->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2253 "/usr/local/yacco2/library/parser.w"

}
Remap_token(token)
if((YACCO2_T__!=0)&&(sym_lookup_functor__!=0)){
if(sym_lookup_functor__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2258 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<"YACCO2_T__::"
<<thread_no__<<"::"<<thread_name()<<"::"
<<" get_spec_token: returned token "<<token->id__<<" pos: "
<<Pos
<<" enum: "<<token->enumerated_id__
<<" after remap "
<<'"'<<token->id__<<'"'
<<FILE_LINE<<std::endl;
yacco2::lrclog
<<"\t\t::GPS FILE: ";
EXTERNAL_GPSing(token)
yacco2::lrclog
<<" GPS LINE: "
<<token->tok_co_ords__.line_no__
<<" GPS CHR POS: "
<<token->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2276 "/usr/local/yacco2/library/parser.w"

}
}
Remap_return_result
}

/*:338*//*342:*/
//#line 2297 "/usr/local/yacco2/library/parser.w"

void
yacco2::
Parser::
cleanup_stack_due_to_abort(){
yacco2::INT stack_items_to_process= parse_stack__.top_sub__-1;
if(stack_items_to_process> 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<Token_start_pos){
char a[BUFFER_SIZE];

yacco2::KCHARP msg= "Error - Subcript Pos value < %i --- out of bounds";
sprintf(a,msg,Token_start_pos);
Yacco2_faulty_precondition(a,__FILE__,__LINE__);
exit(1);
}


/*:554*/
//#line 2348 "/usr/local/yacco2/library/parser.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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 383 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::"<<fsm_tbl__->id__<<"::epsilon"
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 387 "/usr/local/yacco2/library/macros.w"

}
}

/*:582*/
//#line 2409 "/usr/local/yacco2/library/parser.w"

return;
}


/*:351*/
//#line 2402 "/usr/local/yacco2/library/parser.w"

/*361:*/
//#line 2509 "/usr/local/yacco2/library/parser.w"

Cparse_record*pr;
/*353:*/
//#line 2419 "/usr/local/yacco2/library/parser.w"

pr= parse_stack__.top__;

/*:353*/
//#line 2511 "/usr/local/yacco2/library/parser.w"

/*579:*/
//#line 346 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 349 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_TH__::"<<thread_no__
<<"::"<<fsm_tbl__->id__<<":: Popping items from stack # to pop: "
<<No_to_remove
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 354 "/usr/local/yacco2/library/macros.w"

}
}

/*:579*/
//#line 2512 "/usr/local/yacco2/library/parser.w"

while(No_to_remove> 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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 396 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__;
yacco2::lrclog
<<"::"<<fsm_tbl__->id__<<"::popped state:: ";
yacco2::lrclog
<<pr->state__->state_no__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 403 "/usr/local/yacco2/library/macros.w"

}
}

/*:583*/
//#line 2514 "/usr/local/yacco2/library/parser.w"

/*356:*/
//#line 2437 "/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 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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 414 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::"<<fsm_tbl__->id__
<<"::exposed rule/terminal:: NULL due to invisible shift"
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 419 "/usr/local/yacco2/library/macros.w"

}
}

/*:584*/
//#line 2454 "/usr/local/yacco2/library/parser.w"

goto next_stack_element_to_remove;
}

/*:357*/
//#line 2516 "/usr/local/yacco2/library/parser.w"

/*585:*/
//#line 424 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 428 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::"<<fsm_tbl__->id__
<<"::exposed rule/terminal:: "<<parse_stack__.top__->symbol__->id__
<<' '<<parse_stack__.top__->symbol__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 434 "/usr/local/yacco2/library/macros.w"

}
}

/*:585*/
//#line 2517 "/usr/local/yacco2/library/parser.w"

/*358:*/
//#line 2465 "/usr/local/yacco2/library/parser.w"

if(pr->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 446 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__<<"::"
<<fsm_tbl__->id__
<<"::AD deleting exposed rule/terminal:: "
<<parse_stack__.top__->symbol__->id__<<' '
<<parse_stack__.top__->symbol__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 453 "/usr/local/yacco2/library/macros.w"

}
}
}

/*:586*/
//#line 2472 "/usr/local/yacco2/library/parser.w"

if(pr->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 469 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__<<"::"
<<fsm_tbl__->id__
<<"::AB deleting exposed rule/terminal:: "
<<parse_stack__.top__->symbol__->id__<<' '
<<parse_stack__.top__->symbol__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 476 "/usr/local/yacco2/library/macros.w"

}
}
}

/*:587*/
//#line 2522 "/usr/local/yacco2/library/parser.w"

/*360:*/
//#line 2488 "/usr/local/yacco2/library/parser.w"

if(pr->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 362 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_TH__::"<<thread_no__
<<"::"<<fsm_tbl__->id__<<":: Finished Popping items from stack"
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 366 "/usr/local/yacco2/library/macros.w"

}
}


/*:580*/
//#line 2528 "/usr/local/yacco2/library/parser.w"


/*:361*/
//#line 2403 "/usr/local/yacco2/library/parser.w"

}

/*:350*//*362:*/
//#line 2531 "/usr/local/yacco2/library/parser.w"

void
yacco2::
Parser::
clear_parse_stack(){
yacco2::INT s= parse_stack__.top_sub__-1;
if(s> 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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2573 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<"YACCO2_T__::"
<<thread_no__<<"::"<<thread_name()<<"::"
<<" reset_current_token pos: "
<<Pos<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2578 "/usr/local/yacco2/library/parser.w"

}
current_token_pos__= Pos;
current_token__= (*token_supplier__)[Pos];
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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2583 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<"YACCO2_T__::"
<<thread_no__<<"::"<<thread_name()<<"::"
<<" reset_current_token: token to: "<<current_token__->id__<<" pos: "
<<current_token_pos__
<<" enum: "<<current_token__->enumerated_id__
<<'"'<<current_token__->id__<<'"'
<<FILE_LINE<<std::endl;
yacco2::lrclog
<<"\t\t::GPS FILE: ";
EXTERNAL_GPSing(current_token__)
yacco2::lrclog
<<" GPS LINE: "
<<current_token__->tok_co_ords__.line_no__
<<" GPS CHR POS: "
<<current_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2600 "/usr/local/yacco2/library/parser.w"

}
}

/*:365*//*366:*/
//#line 2605 "/usr/local/yacco2/library/parser.w"

void
yacco2::
Parser::
override_current_token
(yacco2::CAbs_lr1_sym&Token
,yacco2::UINT Pos){
current_token_pos__= Pos;
current_token__= &Token;
}

/*:366*//*367:*/
//#line 2617 "/usr/local/yacco2/library/parser.w"

void
yacco2::
Parser::
override_current_token_pos(yacco2::UINT Pos){
current_token_pos__= Pos;
}

/*:367*//*368:*/
//#line 2626 "/usr/local/yacco2/library/parser.w"

yacco2::UINT
yacco2::
Parser::
current_token_pos(){
return current_token_pos__;
}

/*:368*//*369:*/
//#line 2635 "/usr/local/yacco2/library/parser.w"

void
yacco2::
Parser::
get_shift_s_next_token(){
get_next_token();
}

/*:369*//*371:*/
//#line 2646 "/usr/local/yacco2/library/parser.w"

yacco2::KCHARP
yacco2::
Parser::
thread_name(){
return thread_name__;
}

/*:371*//*372:*/
//#line 2658 "/usr/local/yacco2/library/parser.w"

yacco2::Thread_entry*
yacco2::
Parser::
thread_entry(){
return thread_entry__;
}

/*:372*//*375:*/
//#line 2740 "/usr/local/yacco2/library/parser.w"

yacco2::THR_result
Parser::start_procedure_call(yacco2::State&S){
th_active_cnt__= 1;
no_requested_ths_to_run__= 1;
/*614:*/
//#line 981 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 983 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__
<<"::"<<thread_name()<<" calling PROC::"

<<" --> before procedure call"
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 989 "/usr/local/yacco2/library/macros.w"

}

/*:614*/
//#line 2745 "/usr/local/yacco2/library/parser.w"

THR_result rslt= (*S.proc_call_addr__)(this);
/*615:*/
//#line 993 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 995 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__
<<"::"<<thread_name()
<<" returned from PROC::"

<<" result: "<<rslt
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 1002 "/usr/local/yacco2/library/macros.w"

}

/*:615*/
//#line 2747 "/usr/local/yacco2/library/parser.w"

return rslt;
}

/*:375*//*376:*/
//#line 2754 "/usr/local/yacco2/library/parser.w"

bool
yacco2::
Parser::
spawn_thread_manually(yacco2::USINT Thread_id){
yacco2::thread_array_record*thd_stable= (yacco2::thread_array_record*)THDS_STABLE__;
Thread_entry**thd_tbl= (Thread_entry**)&thd_stable->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 925 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__<<"::"<<fsm_tbl__->id__
<<" --> start threads"
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 929 "/usr/local/yacco2/library/macros.w"

}

/*:610*/
//#line 3000 "/usr/local/yacco2/library/parser.w"

/*384:*/
//#line 2945 "/usr/local/yacco2/library/parser.w"

th_active_cnt__= th_lst__.size();
no_requested_ths_to_run__= th_active_cnt__;
yacco2_threads_to_run_iter_type i= th_lst__.begin();
yacco2_threads_to_run_iter_type ie= th_lst__.end();
USINT new_r_w_cnt= supplier_r_w_cnt__+no_requested_ths_to_run__-1;
if(new_r_w_cnt> 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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2831 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Attempting to acquire thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2833 "/usr/local/yacco2/library/parser.w"

}
LOCK_MUTEX(yacco2::TH_TBL_MU);
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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2837 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Acquired thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2839 "/usr/local/yacco2/library/parser.w"

}

/*:380*/
//#line 2963 "/usr/local/yacco2/library/parser.w"

#ifndef VMS111__
if(no_requested_ths_to_run__> 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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 1136 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__
<<"::"<<thread_name()
<<" PROC CALL ALREADY IN USE so call its thread "
<<" Caller parser::"<<pp_requesting_parallelism__->thread_no__
<<"::"<<pp_requesting_parallelism__->thread_name()
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 1143 "/usr/local/yacco2/library/macros.w"

}

/*:623*/
//#line 2968 "/usr/local/yacco2/library/parser.w"

goto thread_call;
}
Parallel_thread_proc_call_table[pe->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2845 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Attempting to release thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2847 "/usr/local/yacco2/library/parser.w"

}
UNLOCK_MUTEX(yacco2::TH_TBL_MU);
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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2851 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Released thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2853 "/usr/local/yacco2/library/parser.w"

}

/*:381*/
//#line 2972 "/usr/local/yacco2/library/parser.w"

/*614:*/
//#line 981 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 983 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__
<<"::"<<thread_name()<<" calling PROC::"

<<" --> before procedure call"
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 989 "/usr/local/yacco2/library/macros.w"

}

/*:614*/
//#line 2973 "/usr/local/yacco2/library/parser.w"

THR_result rslt= (*pe->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2831 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Attempting to acquire thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2833 "/usr/local/yacco2/library/parser.w"

}
LOCK_MUTEX(yacco2::TH_TBL_MU);
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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2837 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Acquired thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2839 "/usr/local/yacco2/library/parser.w"

}

/*:380*/
//#line 2975 "/usr/local/yacco2/library/parser.w"

Parallel_thread_proc_call_table[pe->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2845 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Attempting to release thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2847 "/usr/local/yacco2/library/parser.w"

}
UNLOCK_MUTEX(yacco2::TH_TBL_MU);
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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2851 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Released thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2853 "/usr/local/yacco2/library/parser.w"

}

/*:381*/
//#line 2977 "/usr/local/yacco2/library/parser.w"

/*615:*/
//#line 993 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 995 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__
<<"::"<<thread_name()
<<" returned from PROC::"

<<" result: "<<rslt
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 1002 "/usr/local/yacco2/library/macros.w"

}

/*:615*/
//#line 2978 "/usr/local/yacco2/library/parser.w"

return CALLED_AS_PROC;
}
#endif
thread_call:{
for(;i!=ie;++i){
pe= *i;
/*620:*/
//#line 1090 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 1092 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"
<<"pe*: "<<pe
<<" thread name: "<<pe->thread_fnct_name__
<<" thread proc*: "<<pe->thread_fnct_ptr__
<<" thread id: "<<pe->thd_id__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 1099 "/usr/local/yacco2/library/macros.w"

}

/*:620*/
//#line 2985 "/usr/local/yacco2/library/parser.w"

/*382:*/
//#line 2861 "/usr/local/yacco2/library/parser.w"

int thread_disposition(0);
Parallel_thread_list_type&i= Parallel_thread_table[pe->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 1070 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"
<<tb->grammar_s_parser__->thread_no__
<<"::"<<tb->grammar_s_parser__->thread_name()
<<" th_blk*: "<<this
<<" th_blk*: "<<tb
<<" grammar parser: "<<tb->grammar_s_parser__
<<" #: "<<tb->thd_id__
<<" st: "<<tb->status__
<<" thds in launched list "
<<FILE_LINE<<std::endl;
yacco2::lrclog
<<"------->"
<<tb->grammar_s_parser__->thread_no__
<<"::"<<tb->grammar_s_parser__->fsm_tbl__->id__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 1086 "/usr/local/yacco2/library/macros.w"

}

/*:619*/
//#line 2875 "/usr/local/yacco2/library/parser.w"

if(tb->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 942 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__
<<"::--> parallel thread worker fnd in thread table CALL WORKER: "
<<tb->grammar_s_parser__->thread_name()
<<" thread obj*:"<<tb->grammar_s_parser__
<<" parm*: "<<tb->grammar_s_parser__->pp_requesting_parallelism__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 949 "/usr/local/yacco2/library/macros.w"

}

/*:611*/
//#line 2902 "/usr/local/yacco2/library/parser.w"

UNLOCK_MUTEX_OF_CALLED_PARSER(tb->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 972 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__
<<"::"<<pe->thread_fnct_name__
<<" --> parallel thread NOT fnd in thread table"
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 977 "/usr/local/yacco2/library/macros.w"

}

/*:613*/
//#line 2909 "/usr/local/yacco2/library/parser.w"

THR_result result= CREATE_THREAD(pe->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 961 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__
<<"::"<<pe->thread_fnct_name__
<<" --> parallel thread fnd in thread table BUT ALL ARE BUSY "
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 966 "/usr/local/yacco2/library/macros.w"

}

/*:612*/
//#line 2914 "/usr/local/yacco2/library/parser.w"

yacco2::THR_result result= CREATE_THREAD(pe->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 564 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_TH__::"<<"requestor of parallelism* : "
<<" pp id: "<<thread_no__<<"::"
<<thread_name()<<" parallel PP started: "<<pe->thread_fnct_name__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 569 "/usr/local/yacco2/library/macros.w"

}
}

/*:591*/
//#line 2989 "/usr/local/yacco2/library/parser.w"

}
}
/*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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2845 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Attempting to release thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2847 "/usr/local/yacco2/library/parser.w"

}
UNLOCK_MUTEX(yacco2::TH_TBL_MU);
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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 2851 "/usr/local/yacco2/library/parser.w"

yacco2::lrclog<<" --> Released thread table Mutex"<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 2853 "/usr/local/yacco2/library/parser.w"

}

/*:381*/
//#line 2992 "/usr/local/yacco2/library/parser.w"

return CALLED_AS_THREAD;

/*:384*/
//#line 3001 "/usr/local/yacco2/library/parser.w"

}

/*:385*//*386:*/
//#line 3017 "/usr/local/yacco2/library/parser.w"

void
yacco2::
Parser::
call_arbitrator(yacco2::Type_pp_fnct_ptr The_judge){
if(th_accepting_cnt__==1){
arbitrated_token__= &pp_accept_queue__[1];
pp_accept_queue_idx__= 1;
return;
}
(*The_judge)(this);
}
/*:386*//*393:*/
//#line 3076 "/usr/local/yacco2/library/parser.w"

void
yacco2::
Parser::
wait_for_event(){
/*601:*/
//#line 819 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 821 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__
<<"::"<<thread_name()<<" -->WAIT_FOR_EVENT "
<<" # threads to run:: "<<no_requested_ths_to_run__
<<" # active threads: "<<th_active_cnt__
<<" # competing threads: "<<no_competing_pp_ths__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 828 "/usr/local/yacco2/library/macros.w"

}

/*:601*/
//#line 3081 "/usr/local/yacco2/library/parser.w"

#if THREAD_LIBRARY_TO_USE__ == 1
/*394:*/
//#line 3104 "/usr/local/yacco2/library/parser.w"

COND_WAIT(cv__,mu__,*this);
cv_cond__= WAIT_FOR_EVENT;

/*:394*/
//#line 3083 "/usr/local/yacco2/library/parser.w"

#else
/*394:*/
//#line 3104 "/usr/local/yacco2/library/parser.w"

COND_WAIT(cv__,mu__,*this);
cv_cond__= WAIT_FOR_EVENT;

/*:394*/
//#line 3085 "/usr/local/yacco2/library/parser.w"

#endif
/*602:*/
//#line 834 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 836 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<thread_no__
<<"::"<<thread_name()<<" MESSAGE RECEIVED from "
<<from_thread__->thread_no__
<<"::"<<from_thread__->thread_name()
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 842 "/usr/local/yacco2/library/macros.w"

}

/*:602*/
//#line 3087 "/usr/local/yacco2/library/parser.w"

}

/*:393*//*396:*/
//#line 3146 "/usr/local/yacco2/library/parser.w"

void
yacco2::
Parser::
post_event_to_requesting_grammar
(yacco2::Parser&To_thread
,yacco2::INT Message_id
,yacco2::Parser&From_thread){
/*603:*/
//#line 846 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 848 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<From_thread.thread_no__<<"::"
<<From_thread.thread_name()
<<" -----> Posting message to: "
<<To_thread.thread_no__<<"::"<<To_thread.thread_name()
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 854 "/usr/local/yacco2/library/macros.w"

}

/*:603*/
//#line 3154 "/usr/local/yacco2/library/parser.w"

/*398:*/
//#line 3167 "/usr/local/yacco2/library/parser.w"

To_thread.from_thread__= &From_thread;
To_thread.msg_id__= Message_id;


/*:398*/
//#line 3155 "/usr/local/yacco2/library/parser.w"

/*397:*/
//#line 3161 "/usr/local/yacco2/library/parser.w"

/*604:*/
//#line 858 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 860 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<From_thread.thread_no__<<"::"
<<From_thread.thread_name()
<<" -----> before SIGNAL_COND_VAR() to signal wakeup grammar for: "
<<To_thread.thread_no__<<"::"<<To_thread.thread_name()
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 866 "/usr/local/yacco2/library/macros.w"

}

/*:604*/
//#line 3162 "/usr/local/yacco2/library/parser.w"

SIGNAL_COND_VAR(To_thread,*this);
/*605:*/
//#line 870 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 872 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_MSG__::"<<From_thread.thread_no__<<"::"
<<From_thread.thread_name()
<<" -----> after SIGNAL_COND_VAR() to waken grammar of "
<<To_thread.thread_no__<<"::"
<<To_thread.thread_name()
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 879 "/usr/local/yacco2/library/macros.w"

}

/*:605*/
//#line 3164 "/usr/local/yacco2/library/parser.w"


/*:397*/
//#line 3156 "/usr/local/yacco2/library/parser.w"

}

/*:396*//*399:*/
//#line 3184 "/usr/local/yacco2/library/parser.w"

bool
yacco2::
Parser::
have_all_threads_reported_back(){
if(pp_requesting_parallelism__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 3204 "/usr/local/yacco2/library/parser.w"

char a[BUFFER_SIZE];
int i= 1;
int ie= th_accepting_cnt__;
KCHARP grammar_having_logic_bug= 
"abort_accept_queue_irregularites "
"- Overflow on accept queue Grammar name: %s in parse state: %i";
sprintf(a,grammar_having_logic_bug,fsm_tbl__->id__,top_stack_record()->state__->state_no__);
yacco2::lrclog<<a<<FILE_LINE<<std::endl;

yacco2::lrclog<<" List of launched threads"<<__FILE__<<__LINE__<<std::endl;
KCHARP thread_in_launched_list= "    - %s";
yacco2_threads_to_run_iter_type ii= th_lst__.begin();
yacco2_threads_to_run_iter_type iie= th_lst__.end();
for(;ii!=iie;++ii){
Thread_entry*pe= *ii;
sprintf(a,thread_in_launched_list,pe->thread_fnct_name__);
yacco2::lrclog<<a<<FILE_LINE<<std::endl;
}

yacco2::lrclog<<" List of potential accept parse Tes"<<__FILE__<<__LINE__<<std::endl;
KCHARP no_of_accept_tokens_in_queue= "    no of accept tokens in queue: %i";
sprintf(a,no_of_accept_tokens_in_queue,th_accepting_cnt__);
yacco2::lrclog<<a<<FILE_LINE<<std::endl;

KCHARP accept_queue_tokens= "    - id: %s, token position: %i";
for(;i<=ie;++i){
sprintf(a,accept_queue_tokens
,pp_accept_queue__[i].accept_token__->id__
,pp_accept_queue__[i].accept_token_pos__);
yacco2::lrclog<<a<<FILE_LINE<<std::endl;
}
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 3236 "/usr/local/yacco2/library/parser.w"


KCHARP msg= 
"Overflow on Accept queue no of items: %i not eq to thread accepting cnt: %i\n"
"This means more than 1 thread adding same accept token into queue?";
sprintf(a,msg,th_accepting_cnt__+1,th_accepting_cnt__);
Yacco2_faulty_precondition(a,__FILE__,__LINE__);
exit(1);
}
/*:401*//*402:*/
//#line 3249 "/usr/local/yacco2/library/parser.w"

void
yacco2::
Parser::
abort_no_selected_accept_parse_in_arbitrator(){
/*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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 3254 "/usr/local/yacco2/library/parser.w"

char a[BUFFER_SIZE];
int i= 1;
int ie= th_accepting_cnt__;
KCHARP grammar_having_logic_bug= 
"abort_no_selected_accept_parse_in_arbitrator "
"- No selected accept T Grammar name: %s in parse state: %i";
sprintf(a,grammar_having_logic_bug,fsm_tbl__->id__,top_stack_record()->state__->state_no__);
yacco2::lrclog<<a<<FILE_LINE<<std::endl;

yacco2::lrclog<<" List of launched threads"<<__FILE__<<__LINE__<<std::endl;
KCHARP thread_in_launched_list= "    - %s";
yacco2_threads_to_run_iter_type ii= th_lst__.begin();
yacco2_threads_to_run_iter_type iie= th_lst__.end();
for(;ii!=iie;++ii){
Thread_entry*pe= *ii;
sprintf(a,thread_in_launched_list,pe->thread_fnct_name__);
yacco2::lrclog<<a<<FILE_LINE<<std::endl;
}

yacco2::lrclog<<" List of potential accept parse Tes"<<__FILE__<<__LINE__<<std::endl;
KCHARP no_of_accept_tokens_in_queue= "    no of accept tokens in queue: %i";
sprintf(a,no_of_accept_tokens_in_queue,th_accepting_cnt__);
yacco2::lrclog<<a<<FILE_LINE<<std::endl;

KCHARP accept_queue_tokens= "    - id: %s, token position: %i";
for(;i<=ie;++i){
sprintf(a,accept_queue_tokens
,pp_accept_queue__[i].accept_token__->id__
,pp_accept_queue__[i].accept_token_pos__);
yacco2::lrclog<<a<<FILE_LINE<<std::endl;
}
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 3286 "/usr/local/yacco2/library/parser.w"


KCHARP msg= 
"No selected accept parse T no of items: %i \n";
sprintf(a,msg,th_accepting_cnt__);
Yacco2_faulty_precondition(a,__FILE__,__LINE__);
exit(1);
}


/*:402*//*414:*/
//#line 3366 "/usr/local/yacco2/library/parser.w"

void
yacco2::
Parser::
clean_up(){
if(th_accepting_cnt__> 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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 641 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_TH__::"<<thread_no__<<"::"
<<fsm_tbl__->id__<<"::"
<<"parallel parsing received message from id:"
<<from_thread__->thread_no__<<"::"
<<from_thread__->thread_name()
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 648 "/usr/local/yacco2/library/macros.w"

}
}
}

/*:594*/
//#line 3418 "/usr/local/yacco2/library/parser.w"

/*416:*/
//#line 3399 "/usr/local/yacco2/library/parser.w"

if(result==th_accepting_cnt__!=0)goto proc_call_successful;
else goto proc_call_unsuccessful;

/*:416*/
//#line 3419 "/usr/local/yacco2/library/parser.w"

proc_call_successful:
{
/*417:*/
//#line 3404 "/usr/local/yacco2/library/parser.w"

top_stack_record()->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 578 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::||||||||||ACCEPTED token POS: "
<<arbitrated_token__->accept_token_pos__
<<" token*: "<<arbitrated_token__->accept_token__<<" token: "
<<arbitrated_token__->accept_token__->id__<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS FILE: ";
EXTERNAL_GPSing(arbitrated_token__->accept_token__)
yacco2::lrclog
<<" GPS LINE: "
<<arbitrated_token__->accept_token__->tok_co_ords__.line_no__
<<" GPS CHR POS: "
<<arbitrated_token__->accept_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::||||||||||ACCEPTED la token POS: "
<<arbitrated_token__->la_token_pos__<<" la token: "
<<arbitrated_token__->la_token__->id__<<std::endl;
yacco2::lrclog<<"\t"<<thread_no__
<<"::GPS LA FILE: ";
EXTERNAL_GPSing(arbitrated_token__->la_token__)
yacco2::lrclog
<<" GPS LA LINE: "
<<arbitrated_token__->la_token__->tok_co_ords__.line_no__
<<" GPS LA CHR POS: "
<<arbitrated_token__->la_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 606 "/usr/local/yacco2/library/macros.w"

}
}


/*:592*/
//#line 3424 "/usr/local/yacco2/library/parser.w"

proc_call_shift(*arbitrated_token__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 616 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::|||re-aligned token stream la boundry POS: "
<<current_token_pos__<<" la token: "
<<current_token__->id__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS RE-ALIGN FILE: ";
EXTERNAL_GPSing(current_token__)
yacco2::lrclog
<<" GPS RE-ALIGN  LINE: "
<<current_token__->tok_co_ords__.line_no__
<<" GPS RE-ALIGN CHR POS: "
<<current_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 631 "/usr/local/yacco2/library/macros.w"

}
}

/*:593*/
//#line 3427 "/usr/local/yacco2/library/parser.w"

/*408:*/
//#line 3331 "/usr/local/yacco2/library/parser.w"

arbitrated_token__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 641 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_TH__::"<<thread_no__<<"::"
<<fsm_tbl__->id__<<"::"
<<"parallel parsing received message from id:"
<<from_thread__->thread_no__<<"::"
<<from_thread__->thread_name()
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 648 "/usr/local/yacco2/library/macros.w"

}
}
}

/*:594*/
//#line 3463 "/usr/local/yacco2/library/parser.w"

/*409:*/
//#line 3335 "/usr/local/yacco2/library/parser.w"

if(th_accepting_cnt__!=0)goto parallelism_successful;
else goto parallelism_unsuccessful;

/*:409*/
//#line 3464 "/usr/local/yacco2/library/parser.w"

parallelism_successful:
/*420:*/
//#line 3443 "/usr/local/yacco2/library/parser.w"

top_stack_record()->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 578 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::||||||||||ACCEPTED token POS: "
<<arbitrated_token__->accept_token_pos__
<<" token*: "<<arbitrated_token__->accept_token__<<" token: "
<<arbitrated_token__->accept_token__->id__<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS FILE: ";
EXTERNAL_GPSing(arbitrated_token__->accept_token__)
yacco2::lrclog
<<" GPS LINE: "
<<arbitrated_token__->accept_token__->tok_co_ords__.line_no__
<<" GPS CHR POS: "
<<arbitrated_token__->accept_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::||||||||||ACCEPTED la token POS: "
<<arbitrated_token__->la_token_pos__<<" la token: "
<<arbitrated_token__->la_token__->id__<<std::endl;
yacco2::lrclog<<"\t"<<thread_no__
<<"::GPS LA FILE: ";
EXTERNAL_GPSing(arbitrated_token__->la_token__)
yacco2::lrclog
<<" GPS LA LINE: "
<<arbitrated_token__->la_token__->tok_co_ords__.line_no__
<<" GPS LA CHR POS: "
<<arbitrated_token__->la_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 606 "/usr/local/yacco2/library/macros.w"

}
}


/*:592*/
//#line 3475 "/usr/local/yacco2/library/parser.w"

parallel_shift(*arbitrated_token__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 616 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::|||re-aligned token stream la boundry POS: "
<<current_token_pos__<<" la token: "
<<current_token__->id__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS RE-ALIGN FILE: ";
EXTERNAL_GPSing(current_token__)
yacco2::lrclog
<<" GPS RE-ALIGN  LINE: "
<<current_token__->tok_co_ords__.line_no__
<<" GPS RE-ALIGN CHR POS: "
<<current_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 631 "/usr/local/yacco2/library/macros.w"

}
}

/*:593*/
//#line 3478 "/usr/local/yacco2/library/parser.w"

/*408:*/
//#line 3331 "/usr/local/yacco2/library/parser.w"

arbitrated_token__->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 641 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"YACCO2_TH__::"<<thread_no__<<"::"
<<fsm_tbl__->id__<<"::"
<<"parallel parsing received message from id:"
<<from_thread__->thread_no__<<"::"
<<from_thread__->thread_name()
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 648 "/usr/local/yacco2/library/macros.w"

}
}
}

/*:594*/
//#line 3509 "/usr/local/yacco2/library/parser.w"

/*409:*/
//#line 3335 "/usr/local/yacco2/library/parser.w"

if(th_accepting_cnt__!=0)goto parallelism_successful;
else goto parallelism_unsuccessful;

/*:409*/
//#line 3510 "/usr/local/yacco2/library/parser.w"

parallelism_successful:{
if(yacco2::PTR_AR_for_manual_thread_spawning==0){
arbitrated_token__= &pp_accept_queue__[1];
pp_accept_queue_idx__= 1;
}else{
call_arbitrator(yacco2::PTR_AR_for_manual_thread_spawning);
}

/*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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 578 "/usr/local/yacco2/library/macros.w"

yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::||||||||||ACCEPTED token POS: "
<<arbitrated_token__->accept_token_pos__
<<" token*: "<<arbitrated_token__->accept_token__<<" token: "
<<arbitrated_token__->accept_token__->id__<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::GPS FILE: ";
EXTERNAL_GPSing(arbitrated_token__->accept_token__)
yacco2::lrclog
<<" GPS LINE: "
<<arbitrated_token__->accept_token__->tok_co_ords__.line_no__
<<" GPS CHR POS: "
<<arbitrated_token__->accept_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
yacco2::lrclog<<"\tYACCO2_TH__::"<<thread_no__
<<"::||||||||||ACCEPTED la token POS: "
<<arbitrated_token__->la_token_pos__<<" la token: "
<<arbitrated_token__->la_token__->id__<<std::endl;
yacco2::lrclog<<"\t"<<thread_no__
<<"::GPS LA FILE: ";
EXTERNAL_GPSing(arbitrated_token__->la_token__)
yacco2::lrclog
<<" GPS LA LINE: "
<<arbitrated_token__->la_token__->tok_co_ords__.line_no__
<<" GPS LA CHR POS: "
<<arbitrated_token__->la_token__->tok_co_ords__.pos_in_line__
<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 606 "/usr/local/yacco2/library/macros.w"

}
}


/*:592*/
//#line 3519 "/usr/local/yacco2/library/parser.w"

/*406:*/
//#line 3316 "/usr/local/yacco2/library/parser.w"

clean_up();
return Parser::paralleled;

/*:406*/
//#line 3520 "/usr/local/yacco2/library/parser.w"

}
parallelism_unsuccessful:
/*405:*/
//#line 3299 "/usr/local/yacco2/library/parser.w"

clean_up();
return Parser::erred;

/*:405*/
//#line 3523 "/usr/local/yacco2/library/parser.w"

}

//#line 1 "/usr/local/yacco2/library/runtime_env.w"







/*:422*//*428:*/
//#line 83 "/usr/local/yacco2/library/runtime_env.w"

std::list<std::string> yacco2::O2_LOGICALS__;
yacco2::gbl_file_map_type yacco2::FILE_TBL__;
std::vector<yacco2::UINT> 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: "<<yacco2::Lr1_VERSION
<<" thrown from source file: "<<file__
<<" line: "<<line__
<<__FILE__<<__LINE__<<std::endl;
std::cout
<<" Version: "<<yacco2::Lr1_VERSION
<<" thrown from source file: "<<file__
<<" line: "<<line__
<<__FILE__<<__LINE__<<std::endl;
}

yacco2::
Yacco2_faulty_precondition::
Yacco2_faulty_precondition(yacco2::KCHARP Message
,yacco2::KCHARP File
,yacco2::UINT Line)
:Source_info(File,Line){
yacco2::lrclog<<"Yacco2_faulty_precondition: "<<Message<<' '<<__FILE__<<": "<<__LINE__<<std::endl;
std::cout<<"Yacco2_faulty_precondition: "<<Message<<std::endl;
}

yacco2::
Yacco2_faulty_postcondition::
Yacco2_faulty_postcondition(yacco2::KCHARP Message
,yacco2::KCHARP File
,yacco2::UINT Line)
:Source_info(File,Line){
yacco2::lrclog<<"Yacco2_faulty_postcondition: "<<Message<<' '<<__FILE__<<": "<<__LINE__<<std::endl;
std::cout<<"Yacco2_faulty_postcondition: "<<Message<<std::endl;
}


/*:430*//*432:*/
//#line 208 "/usr/local/yacco2/library/runtime_env.w"

extern
void yacco2::Delete_tokens(yacco2::TOKEN_GAGGLE&Tks,bool Do_delete){
return;
using namespace NS_yacco2_k_symbols;
static yacco2::set_of_objs_type deleted_syms;
static yacco2::set_of_objs_type dont_delete_syms;
static bool onetime(OFF);
if(onetime==OFF){
onetime= ON;
dont_delete_syms.insert(PTR_LR1_eolr__);
dont_delete_syms.insert(PTR_LR1_questionable_shift_operator__);
dont_delete_syms.insert(PTR_LR1_eog__);
dont_delete_syms.insert(PTR_LR1_parallel_operator__);
dont_delete_syms.insert(PTR_LR1_invisible_shift_operator__);
dont_delete_syms.insert(PTR_LR1_all_shift_operator__);
dont_delete_syms.insert(PTR_LR1_fset_transience_operator__);
}
if(Do_delete==ON){
set_of_objs_iter_type k= deleted_syms.begin();
set_of_objs_iter_type ke= deleted_syms.end();
for(;k!=ke;++k){
CAbs_lr1_sym*sym= *k;

}
return;
}
TOKEN_GAGGLE_ITER i= Tks.begin();
TOKEN_GAGGLE_ITER ie= Tks.end();
for(;i!=ie;++i){
yacco2::CAbs_lr1_sym*sym= *i;
yacco2::set_of_objs_iter_type j;
j= deleted_syms.find(sym);
if(j!=deleted_syms.end())continue;
j= dont_delete_syms.find(sym);
if(j!=dont_delete_syms.end())continue;
deleted_syms.insert(sym);
}
}

/*:432*//*433:*/
//#line 255 "/usr/local/yacco2/library/runtime_env.w"

extern
void yacco2::Clear_yacco2_opened_files_dictionary(){
yacco2::FILE_TBL__.clear();
yacco2::STK_FILE_NOS__.clear();
yacco2::FILE_CNT__= 0;

}
//#line 1 "/usr/local/yacco2/library/tree.w"








/*:433*//*636:*/
//#line 1315 "/usr/local/yacco2/library/macros.w"

extern bool
yacco2::trace_parser_env(Parser*parser,bool Trace_type){
/*550:*/
//#line 83 "/usr/local/yacco2/library/constraints.w"

if(parser->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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 1278 "/usr/local/yacco2/library/macros.w"

for(UINT x= 1;x<=parser->parse_stack__.top_sub__;++x)yacco2::lrclog<<".";
yacco2::lrclog<<parser->thread_no__;
yacco2::lrclog<<"::";
yacco2::lrclog<<parser->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"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 1283 "/usr/local/yacco2/library/macros.w"


/*:633*/
//#line 1321 "/usr/local/yacco2/library/macros.w"

/*634:*/
//#line 1286 "/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"<<FILE_LINE<<std::endl;
}

/*:389*/
//#line 1287 "/usr/local/yacco2/library/macros.w"

Cparse_record*i= parser->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<<i->state__->state_no__<<"--";
CAbs_lr1_sym*sym= i->symbol__;
if(sym)yacco2::lrclog<<sym->id__<<"-> ";
else yacco2::lrclog<<"ZEROED OUT SYMBOL"<<"-> ";
}
yacco2::lrclog<<ie->state__->state_no__;

yacco2::lrclog<<FILE_LINE<<std::endl;
/*390:*/
//#line 3060 "/usr/local/yacco2/library/parser.w"

if(yacco2::YACCO2_MU_TRACING__){
yacco2::lrclog<<"YACCO2_MU_TRACING__::Releasing trace mu"<<FILE_LINE<<std::endl;
}
UNLOCK_MUTEX(yacco2::TRACE_MU);

/*:390*/
//#line 1299 "/usr/local/yacco2/library/macros.w"


/*:634*/
//#line 1322 "/usr/local/yacco2/library/macros.w"

return YES;
}

/*:636*/
//#line 482 "/usr/local/yacco2/library/intro.w"

//#line 1 "/usr/local/yacco2/library/constants.w"







/*:36*/
