REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
real::detail::pike_state Struct Reference

VM scratch state for the dynamic storage mode, plus the lookaround sub-scratch. More...

#include <pike.hpp>

Inheritance diagram for real::detail::pike_state:
[legend]
Collaboration diagram for real::detail::pike_state:
[legend]

Public Attributes

std::optional< lookaround_scratchlookaround
 Isolated sub-scratch for bounded lookaround evaluation, built on first use — see real::detail::dynamic_storage::state_type for the measurement that made it lazy.
 
capture_pool pool
 copy-on-write capture blocks (heap-backed).
 
std::optional< lazy_dfafwd_dfa
 Fallback when immut is null; prefer shared_fwd_dfa.
 
std::optional< reverse_dfarev_dfa
 Fallback reverse; prefer shared_rev_dfa.
 
const void * dfa_program {nullptr}
 Program the per-state DFAs were built for (fallback).
 
std::optional< reverse_dfail_prefix_rev
 Fallback IL prefix reverse; prefer shared_il_prefix_rev.
 
const void * il_prefix_for {nullptr}
 Fallback: prefix program il_prefix_rev was built for.
 
const void * il_text {nullptr}
 IL: the haystack il_abandoned refers to (reset the flag when it changes).
 
bool il_abandoned {false}
 IL: a linearity/density guard tripped on this haystack — stay on the core.
 
std::uint32_t il_density_cands {}
 IL candidates seen on this haystack (density sample).
 
std::size_t il_density_origin {npos}
 Byte offset of the first IL candidate this haystack.
 
const void * rare_disc_text {nullptr}
 Rare-disc: haystack rare_disc_abandoned refers to.
 
bool rare_disc_abandoned {false}
 Rare-disc density guard: stay on prefix for this haystack.
 
const void * ac_text {nullptr}
 AC: the haystack ac_dense was decided on.
 
bool ac_decided {false}
 AC: the density sample has run on this haystack.
 
bool ac_dense {false}
 AC: candidates are dense enough that the automaton wins.
 
- Public Attributes inherited from real::detail::basic_pike_state< thread_list, std::vector< eps_entry > >
thread_list list_a
 One of the two thread lists; the run rotates pointers, not indices.
 
thread_list list_b
 The other one — see list_a.
 
std::vector< eps_entrystack
 Epsilon-closure DFS stack.
 
std::int32_t table_class
 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 (filled on a class_table miss).
 
std::int32_t cp_page_class
 Membership bitmap for a cp_class over the 2-byte UTF-8 range [U+0080, U+07FF], and the class it was built for. 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.
 
std::array< std::uint64_t, 30 > cp_page
 1 where the code point (U+0080..U+07FF) is a member (filled on a cp_page_table miss).
 
const void * rows_verified_for
 Program whose membership rows this state has already verified as filled. Lets a walk skip the two acquire loads class_table would otherwise do once per run() — see there.
 
const std::uint8_t * row_ptr
 The verified byte row, cached so the hot path returns it without re-deriving the address.
 
const std::uint64_t * page_ptr
 As row_ptr, for the two-byte page bitmap.
 
std::int32_t hi_class
 Class hi_ptr / hi_never were resolved for; -1 while unresolved.
 
const cp_hi_tablehi_ptr
 The resolved sparse hi table for hi_class, or null when it has none usable.
 
bool hi_never
 Set when hi_class has no high ranges at all, so every cp past the page bitmap misses.
 

Static Public Attributes

static constexpr bool supports_aho_corasick {true}
 Marks a state whose storage benefits from the multi-literal route. A compile-time-sized marker, not a field: the automaton itself lives per REGEX in detail::regex_immutables, so nothing about it belongs in a state that is rebuilt on every search().
 

Additional Inherited Members

- Public Member Functions inherited from real::detail::basic_pike_state< thread_list, std::vector< eps_entry > >
constexpr basic_pike_state () noexcept
 Value-initializes table and cp_page during constant evaluation only.
 

Detailed Description

VM scratch state for the dynamic storage mode, plus the lookaround sub-scratch.


The documentation for this struct was generated from the following file: