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_scratch > lookaround
 Lookaround sub-scratch, built on first use (see real::detail::dynamic_storage::state_type).
 
capture_pool pool
 copy-on-write capture blocks (heap-backed).
 
std::optional< lazy_dfa > fwd_dfa
 Fallback when immut is null; prefer shared_fwd_dfa.
 
std::optional< reverse_dfa > rev_dfa
 Fallback reverse; prefer shared_rev_dfa.
 
const void * dfa_program {nullptr}
 Program the per-state DFAs were built for (fallback).
 
std::optional< reverse_dfa > il_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.
 
const void * lit_text {nullptr}
 Literal search: the subject lit_memo refers to.
 
std::optional< literal_memo > lit_memo
 Literal search: that subject's densities, built at its first literal search.
 
const alternation_pairs * alt_pairs {nullptr}
 Alternation: the regex's probe pairs (regex_immutables::alt_pairs), null until built.
 
const void * alt_text {nullptr}
 Alternation: the subject alt_density refers to.
 
alternation_density alt_density {}
 Alternation: that subject's first-byte density (two flags, cheap to build with every state).
 
- 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_entry > stack
 Epsilon-closure DFS stack.
 
std::int32_t table_class
 Class table was built for (-1 = none). One load per byte instead of the bitmap's shift-and-mask, reused across a find_all-style walk.
 
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
 Class cp_page was built for (-1 = none): the 2-byte UTF-8 range [U+0080, U+07FF] in one load from 240 bytes. Higher code points use cp_hi_table, since widening the bitmap would inflate every pattern's hot state and slow the ASCII class loop.
 
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 verified as filled; spares class_table's two acquire loads per run().
 
const std::uint8_t * row_ptr
 The verified byte row, cached for the hot path.
 
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_table * hi_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 marker, not a field: the automaton lives per regex in detail::regex_immutables.
 

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: