|
REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
|
Reusable VM scratch state. More...
#include <pike.hpp>
Public Attributes | |
| ThreadList | lists [2] |
| Current and next thread lists (flipped by index). | |
| EpsVec | stack |
| Epsilon-closure DFS stack. | |
| std::int32_t | table_class {-1} |
| Flat 256-byte membership table for the hot single-class scan, and the class index it was built for (-1 = none). | |
| std::array< std::uint8_t, 256 > | table {} |
| 1 where the byte is in table_class. | |
| std::int32_t | cp_page_class {-1} |
Membership bitmap for a cp_class over the 2-byte UTF-8 range [U+0080, U+07FF], and the class it was built for. A klass_cp scan otherwise binary-searches ~771 ranges per non-ASCII code point; European text lives almost entirely in this range (Latin, IPA, Greek, Cyrillic, Hebrew, Arabic…), so a 240-byte bitmap answers it in one load. Built once per class and reused across a find_all-style walk; code points beyond U+07FF (CJK, astral) fall back to the range search. | |
| std::array< std::uint64_t, 30 > | cp_page {} |
| 1 where the code point (U+0080..U+07FF) is a member. | |
Reusable VM scratch state.
One run allocates nothing once warm (and never allocates with static containers); find_all-style loops reuse the same state across runs. The two thread lists are flipped by index, never swapped.
| ThreadList | The thread-list type (a basic_thread_list). |
| EpsVec | Container for the epsilon-closure stack. |
| std::array<std::uint64_t, 30> real::detail::basic_pike_state< ThreadList, EpsVec >::cp_page {} |
| std::int32_t real::detail::basic_pike_state< ThreadList, EpsVec >::cp_page_class {-1} |
Membership bitmap for a cp_class over the 2-byte UTF-8 range [U+0080, U+07FF], and the class it was built for. A klass_cp scan otherwise binary-searches ~771 ranges per non-ASCII code point; European text lives almost entirely in this range (Latin, IPA, Greek, Cyrillic, Hebrew, Arabic…), so a 240-byte bitmap answers it in one load. Built once per class and reused across a find_all-style walk; code points beyond U+07FF (CJK, astral) fall back to the range search.
| ThreadList real::detail::basic_pike_state< ThreadList, EpsVec >::lists[2] |
| EpsVec real::detail::basic_pike_state< ThreadList, EpsVec >::stack |
| std::array<std::uint8_t, 256> real::detail::basic_pike_state< ThreadList, EpsVec >::table {} |
1 where the byte is in table_class.
| std::int32_t real::detail::basic_pike_state< ThreadList, EpsVec >::table_class {-1} |
Flat 256-byte membership table for the hot single-class scan, and the class index it was built for (-1 = none).
The class-scanning fast paths ([…]+, ./negated-class) test one class for every byte. A flat byte-indexed table answers membership with a single load, versus the bitmap's shift-and-mask (measured ~2x faster in a tight scan — the byte-classification technique used by DFA/JIT engines). It is built once and reused across a find_all-style walk (the state is shared), so it adds nothing to the program or to the static binary.