|
REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
|
One node of a minimal deterministic UTF-8 trie for a code-point class. Its transitions are byte ranges that are pairwise disjoint, so at most one edge matches any byte — that determinism is what makes the byte-program one-pass-friendly. A target >= 0 is a node id; -1 is accept (a code point ends here — the run continues at the construct's successor).
More...
#include <lazy_dfa.hpp>
Public Attributes | |
| std::vector< std::pair< utf8_byte_range, std::int32_t > > | trans |
Outgoing edges: a byte range paired with its target, -1 meaning accept. Pairwise disjoint. | |
One node of a minimal deterministic UTF-8 trie for a code-point class. Its transitions are byte ranges that are pairwise disjoint, so at most one edge matches any byte — that determinism is what makes the byte-program one-pass-friendly. A target >= 0 is a node id; -1 is accept (a code point ends here — the run continues at the construct's successor).
| std::vector<std::pair<utf8_byte_range, std::int32_t> > real::detail::utf8_trie_node::trans |
Outgoing edges: a byte range paired with its target, -1 meaning accept. Pairwise disjoint.
bounds/tails pair builder::build allocates at every level – and build is RECURSIVE, so those cannot share one scratch buffer. The shape that works is a stack-disciplined arena, each level taking a slice and releasing it on return, plus a flat transition pool with the memo's hash and compare working over spans.The root cause sits above all of it: for a class like \w, almost everything this trie recognises is code points a pure-ASCII subject cannot contain, and the subject IS known at search time. An ASCII-first expansion would delete the work rather than make it cheaper – see the design note above build_byte_program.