protected boolean find_recovery_config(boolean debug){
  token error_token;
  int act;
  if (debug)   debug_message("# Finding recovery state on stack");
  while (!shift_under_error()) {
    if (debug)     debug_message("# Pop stack by one, state was # " + ((symbol)stack.peek()).parse_state);
    stack.pop();
    tos--;
    if (stack.empty()) {
      if (debug)       debug_message("# No recovery state found on stack");
      return false;
    }
  }
  act=get_action(((symbol)stack.peek()).parse_state,error_sym());
  if (debug) {
    debug_message("# Recover state found (#" + ((symbol)stack.peek()).parse_state + ")");
    debug_message("# Shifting on error to state #" + (act - 1));
  }
  error_token=new token(error_sym());
  error_token.parse_state=act - 1;
  stack.push(error_token);
  tos++;
  return true;
}

protected boolean find_recovery_config ( boolean debug ) { token error_token ; int act ; if ( debug ) debug_message ( "# Finding recovery state on stack" ) ; while ( ! shift_under_error ( ) ) { if ( debug ) debug_message ( "# Pop stack by one, state was # " + ( ( symbol ) stack . peek ( ) ) . parse_state ) ; stack . pop ( ) ; tos -- ; if ( stack . empty ( ) ) { if ( debug ) debug_message ( "# No recovery state found on stack" ) ; return false ; } } act = get_action ( ( ( symbol ) stack . peek ( ) ) . parse_state , error_sym ( ) ) ; if ( debug ) { debug_message ( "# Recover state found (#" + ( ( symbol ) stack . peek ( ) ) . parse_state + ")" ) ; debug_message ( "# Shifting on error to state #" + ( act - 1 ) ) ; } error_token = new token ( error_sym ( ) ) ; error_token . parse_state = act - 1 ; stack . push ( error_token ) ; tos ++ ; return true ; }
put the ( real ) parse stack into error recovery configuration by popping the stack down to a state that can shift on the special error symbol , then doing the shift . if no suitable state exists on the stack we return false
