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

A non-owning view of everything the engine needs to run one compiled pattern: the borrowed spans, the slot count, the mode flags, the search hints, and the per-regex cache. Both storages hand one of these to the VM, which is why the engine is storage-agnostic. Valid only as long as the program it views is alive. More...

Collaboration diagram for real::detail::program_view:
[legend]

Public Attributes

std::span< const instrcode
 The instruction stream (main + lookaround regions).
 
std::span< const char_classclasses
 Interned character classes.
 
std::span< const named_groupnames
 Named capture groups.
 
std::span< const lookaround_sublookarounds
 Bounded lookaround sub-programs (regions of code).
 
std::span< const cp_classcp_classes
 Match-time code-point classes (for klass_cp).
 
std::span< const code_rangecp_ranges
 Flat range buffer the cp_class slices index into.
 
std::span< const instrprefix_code
 IL: inner-literal prefix sub-program (the reverse start-finder). Empty unless there is a required literal with a top-level prefix. Dynamic-only.
 
std::span< const char_classprefix_classes
 IL: classes for prefix_code.
 
std::span< const cp_classprefix_cp_classes
 IL: code-point classes for prefix_code.
 
std::span< const code_rangeprefix_cp_ranges
 IL: flat range buffer for prefix_cp_classes.
 
std::uint16_t slot_count {2}
 2 * (capture groups + 1).
 
bool byte_mode {}
 flags::bytes mode — positions are raw bytes.
 
bool unicode_word {}
 \b \B \< \> use Unicode word-ness (text mode, not bytes / re.A).
 
pattern_hints hints
 Search-acceleration hints.
 
regex_immutablesimmut {nullptr}
 
const std::uint8_t * class_tables {nullptr}
 Flat byte-class membership tables, class_tables[i * 256 + b], or null when the storage has none pre-built (dynamic, which fills them lazily through immut instead).
 
const std::uint8_t * cp_ascii_tables {nullptr}
 Flat ASCII tables per cp_class: [i * 256 + b]. Null as class_tables.
 
const std::uint64_t * cp_page_tables {nullptr}
 Flat page bitmaps per cp_class: [i * 30]. Null as class_tables.
 

Detailed Description

A non-owning view of everything the engine needs to run one compiled pattern: the borrowed spans, the slot count, the mode flags, the search hints, and the per-regex cache. Both storages hand one of these to the VM, which is why the engine is storage-agnostic. Valid only as long as the program it views is alive.

Member Data Documentation

◆ class_tables

const std::uint8_t* real::detail::program_view::class_tables {nullptr}

Flat byte-class membership tables, class_tables[i * 256 + b], or null when the storage has none pre-built (dynamic, which fills them lazily through immut instead).

Carried here rather than reached through the state type: a state that names the pattern's own arrays is a state that cannot be shared between patterns, and every Pike VM route is then instantiated once per pattern. Compile-time storage points these at its static constexpr arrays, so a constant-folding compiler still sees through to the same addresses.

◆ immut

regex_immutables* real::detail::program_view::immut {nullptr}

Per-regex DFA/one-pass cache (dynamic storage only; else null).


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