private static void run_hooks_impl_(PsiBuilder builder, ErrorState state, @Nullable IElementType elementType) {
    if (state.hooks == null) return;
    PsiBuilder.Marker marker = elementType == null ? null : (PsiBuilder.Marker)builder.getLatestDoneMarker();
    if (elementType != null && marker == null) {
      builder.mark().error(AnalysisBundle.message("parsing.error.no.expected.done.marker.at.offset", builder.getCurrentOffset()));
    }
    while (state.hooks != null && state.hooks.level >= state.level) {
      if (state.hooks.level == state.level) {
        marker = ((Hook<Object>)state.hooks.hook).run(builder, marker, state.hooks.param);
      }
      state.hooks = state.hooks.next;
    }
  }
private static void run_hooks_impl_(PsiBuilder builder, ErrorState state, @Nullable IElementType elementType)