|
REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
|
The prefix-reverse of the inner-literal prefilter (INNER-LITERAL IL.1). Given a required inner literal found at a candidate position, reverse-match the pattern's PREFIX (everything before the literal) to recover the match start — the reverse-inner protocol. Reuses the engine's existing reverse machinery (build_byte_program() + reverse_dfa), just on the prefix sub-program. Inert: nothing routes on it yet (that is IL.2). More...
#include <real/version.hpp>#include <cstddef>#include <cstdint>#include <string_view>#include <real/automata/lazy_dfa.hpp>#include <real/frontend/ast.hpp>#include <real/frontend/compiler.hpp>#include <real/frontend/inner_literal.hpp>Go to the source code of this file.
Namespaces | |
| namespace | real |
| namespace | real::detail |
Functions | |
| std::size_t | real::detail::prefix_reverse_start (const ast &tree, std::int32_t count, flags compile_flags, std::string_view text, std::size_t h, std::size_t min_start) |
The match start for a literal candidate at h: reverse-match the prefix (the first count top-level children) ending at h, bounded below by min_start. count == 0 means the literal is at the head, so the reverse is the identity (the match starts at the candidate). Returns npos when the prefix cannot reach a start (an orphan candidate). Runtime only — the reverse DFA is not constexpr; a static_regex would keep the inner-literal path dynamic. | |
The prefix-reverse of the inner-literal prefilter (INNER-LITERAL IL.1). Given a required inner literal found at a candidate position, reverse-match the pattern's PREFIX (everything before the literal) to recover the match start — the reverse-inner protocol. Reuses the engine's existing reverse machinery (build_byte_program() + reverse_dfa), just on the prefix sub-program. Inert: nothing routes on it yet (that is IL.2).
Definition in file inner_literal_reverse.hpp.