|
REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
|
The per-regex immutable cache the router shares across every find_iter on a regex: the byte- program (klass_cp expanded to the deterministic trie) and, when the pattern is one-pass, the extractor table. Built exactly once, under once, so a const regex used from many threads (the binding shares the compiled object across GIL-released calls) builds it race-free. The mutable DFA transition caches stay per-iterator — they warm per scan and would need a lock here. More...
#include <onepass.hpp>
Public Member Functions | |
| regex_immutables ()=default | |
| regex_immutables (const regex_immutables &) noexcept | |
| regex_immutables (regex_immutables &&) noexcept | |
| regex_immutables & | operator= (const regex_immutables &) noexcept |
| regex_immutables & | operator= (regex_immutables &&) noexcept |
| ~regex_immutables ()=default | |
Public Attributes | |
| byte_program | byte_prog |
| klass_cp-expanded byte program (empty until built). | |
| lazy_byte_alphabet | alphabet |
| byte-class alphabet of byte_prog (shared by both DFAs, else recomputed per scan). | |
| std::optional< onepass > | op_table |
| one-pass extractor, present iff the pattern is one-pass. | |
| byte_program | il_prefix_prog |
| IL: the inner-literal prefix's byte program (ineligible until built). Per-regex so the reverse DFA that spans it is a cheap per-iterator wrapper, not a per-find_iter rebuild. | |
| std::size_t | il_min_haystack {} |
| IL: on a haystack that HAS a candidate, the route only fires at or above this size (0 = always). The prefix reverse DFA's cache is per-iterator and re-warms per find_iter; below N that cost does not amortize and the core is faster. Checked ONLY after the first memmem hit, so a no-match haystack (memmem-only) is never gated. Scaled by the prefix byte-program size (its cache size); see pike_vm::run_inner_literal. | |
| std::once_flag | once |
| guards the one-time build. | |
The per-regex immutable cache the router shares across every find_iter on a regex: the byte- program (klass_cp expanded to the deterministic trie) and, when the pattern is one-pass, the extractor table. Built exactly once, under once, so a const regex used from many threads (the binding shares the compiled object across GIL-released calls) builds it race-free. The mutable DFA transition caches stay per-iterator — they warm per scan and would need a lock here.
Definition at line 501 of file onepass.hpp.
|
default |
|
inlinenoexcept |
Definition at line 514 of file onepass.hpp.
|
inlinenoexcept |
Definition at line 517 of file onepass.hpp.
|
default |
|
inlinenoexcept |
Definition at line 523 of file onepass.hpp.
|
inlinenoexcept |
Definition at line 529 of file onepass.hpp.
| lazy_byte_alphabet real::detail::regex_immutables::alphabet |
byte-class alphabet of byte_prog (shared by both DFAs, else recomputed per scan).
Definition at line 504 of file onepass.hpp.
| byte_program real::detail::regex_immutables::byte_prog |
klass_cp-expanded byte program (empty until built).
Definition at line 503 of file onepass.hpp.
| std::size_t real::detail::regex_immutables::il_min_haystack {} |
IL: on a haystack that HAS a candidate, the route only fires at or above this size (0 = always). The prefix reverse DFA's cache is per-iterator and re-warms per find_iter; below N that cost does not amortize and the core is faster. Checked ONLY after the first memmem hit, so a no-match haystack (memmem-only) is never gated. Scaled by the prefix byte-program size (its cache size); see pike_vm::run_inner_literal.
Definition at line 507 of file onepass.hpp.
| byte_program real::detail::regex_immutables::il_prefix_prog |
IL: the inner-literal prefix's byte program (ineligible until built). Per-regex so the reverse DFA that spans it is a cheap per-iterator wrapper, not a per-find_iter rebuild.
Definition at line 506 of file onepass.hpp.
| std::once_flag real::detail::regex_immutables::once |
guards the one-time build.
Definition at line 508 of file onepass.hpp.
| std::optional<onepass> real::detail::regex_immutables::op_table |
one-pass extractor, present iff the pattern is one-pass.
Definition at line 505 of file onepass.hpp.