protected boolean find_recovery_config(boolean debug)
    {
      Symbol error_token;
      int act;

      if (debug) debug_message("# Finding recovery state on stack");

      /* Remember the right-position of the top symbol on the stack */
      Symbol right = stack.peek();// TUM 20060327 removed .right	
      Symbol left  = right;// TUM 20060327 removed .left	

      /* pop down until we can shift under error Symbol */
      while (!shift_under_error())
	{
	  /* pop the stack */
	  if (debug) 
	    debug_message("# Pop stack by one, state was # " +
	                  stack.peek().parse_state);
          left = stack.pop(); // TUM 20060327 removed .left	
	  tos--;

	  /* if we have hit bottom, we fail */
	  if (stack.empty()) 
	    {
	      if (debug) debug_message("# No recovery state found on stack");
	      return false;
	    }
	}

      /* state on top of the stack can shift under error, find the shift */
      act = get_action(stack.peek().parse_state, error_sym());
      if (debug) 
	{
	  debug_message("# Recover state found (#" + 
			stack.peek().parse_state + ")");
	  debug_message("# Shifting on error to state #" + (act-1));
	}

      /* build and shift a special error Symbol */
      error_token = getSymbolFactory().newSymbol("ERROR",error_sym(), left, right);
      error_token.parse_state = act-1;
      error_token.used_by_parser = true;
      stack.push(error_token);
      tos++;

      return true;
    }