private void switchToEagerSearch(RegexProfile profile) { compileEagerSearchNode(); if (eagerSearchNode != EAGER_SEARCH_BAILED_OUT) { LOG_SWITCH_TO_EAGER.fine(() -> "regex " + getSource() + ": switching to eager matching." + (profile == null ? "" : " profile: " + profile)); runRegexSearchNode = insert(eagerSearchNode); } }
LOG_BAILOUT_MESSAGES.fine(() -> mainBailout.getReason() + ": " + regexSource); try { if (shouldLog) { elapsedTimeFallback = timer.getElapsed(); LOG_COMPILER_FALLBACK.fine(() -> String.format("Secondary compiler used (primary bailout due to '%s'): %s", mainBailout.getReason(), regexSource)); } catch (UnsupportedRegexException fallbackBailout) { LOG_COMPILER_FALLBACK.fine(() -> String.format("No compiler handled following regex (primary bailout: '%s'; secondary bailout: '%s'): %s", mainBailout.getReason(), fallbackBailout.getReason(), regexSource)); String bailoutReasons = String.format("%s; %s", mainBailout.getReason(), fallbackBailout.getReason());
} catch (UnsupportedRegexException e) { phaseEnd("TraceFinder NFA Bailout"); LOG_BAILOUT_MESSAGES.fine(() -> "TraceFinder: " + e.getReason() + ": " + source);
private void compileEagerSearchNode() { if (eagerSearchNode == null) { try { TRegexDFAExecutorNode executorNode = tRegexCompiler.compileEagerDFAExecutor(getSource()); eagerSearchNode = new EagerCaptureGroupRegexSearchNode(executorNode); } catch (UnsupportedRegexException e) { LOG_BAILOUT_MESSAGES.fine(() -> e.getReason() + ": " + source); eagerSearchNode = EAGER_SEARCH_BAILED_OUT; } } }