|
REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
|
Storage policy backing real::static_regex: compile-time, stateless.
More...
#include <storage.hpp>
Classes | |
| struct | state_type |
| VM scratch state, all fixed-capacity (zero heap). More... | |
Public Types | |
| using | slot_storage = static_vec< std::size_t, slot_count > |
| Capture-slot container: fixed-capacity, no heap. | |
Public Member Functions | |
| constexpr program_view | view () const |
| Returns a non-owning view of the compile-time program. | |
| constexpr std::string_view | pattern () const |
| Returns the pattern text. | |
| constexpr flags | compiled_flags () const |
| Returns the effective flags. | |
Static Public Attributes | |
| static constexpr bool | is_compile_time {true} |
| Selects the default constructor. | |
| static constexpr flags | effective_flags {F | detail::parse(Pat.view(), F).inline_flags} |
| Flags merged with (?ims). | |
| static constexpr pattern_hints | hints {build().hints} |
| Search hints. | |
| static constexpr std::size_t | code_size {build().code.size()} |
| Instruction count. | |
| static constexpr std::size_t | class_count {build().classes.size()} |
| Distinct class count. | |
| static constexpr std::size_t | name_count {build().names.size()} |
| Named-group count. | |
| static constexpr std::size_t | cp_class_count {build().cp_classes.size()} |
| Code-point class count (klass_cp). | |
| static constexpr std::size_t | cp_range_count {build().cp_ranges.size()} |
| Total code-point ranges. | |
| static constexpr std::uint16_t | slot_count {build().slot_count} |
2*(groups+1). | |
| static constexpr std::array< instr, code_size > | code {take<instr, code_size>(build().code)} |
| The program. | |
| static constexpr std::array< char_class, class_count > | classes |
| Interned classes. | |
| static constexpr std::array< named_group, name_count > | names |
| Named groups. | |
| static constexpr std::array< cp_class, cp_class_count > | cp_classes |
| Code-point classes. | |
| static constexpr std::array< code_range, cp_range_count > | cp_ranges |
| Flat range buffer. | |
| static constexpr std::size_t | max_blocks {(5 * code_size) + 8} |
Static Private Member Functions | |
| static constexpr dynamic_program | build () |
| Returns the freshly built program (used for both measuring and filling). | |
| template<typename T , std::size_t N, typename Vec > | |
| static constexpr std::array< T, N > | take (const Vec &source) |
Copies the first N elements of v into a fixed array. | |
Storage policy backing real::static_regex: compile-time, stateless.
Every array is a static constexpr member sized exactly by a measuring pass over the same compilation, so a static_regex object is stateless (sizeof 1) and matching allocates nothing.
| Pat | The pattern, as a real::fixed_string non-type parameter. |
| F | Compilation flags. |
Definition at line 793 of file storage.hpp.
| using real::detail::static_storage< Pat, F >::slot_storage = static_vec<std::size_t, slot_count> |
Capture-slot container: fixed-capacity, no heap.
Definition at line 860 of file storage.hpp.
|
inlinestaticconstexprprivate |
Returns the freshly built program (used for both measuring and filling).
Runs only at compile time (a static_regex instantiation), so it is invisible to the runtime coverage report; it is exercised by the constexpr static_asserts in tests/test_static.cpp and tests/test_constexpr.cpp.
Definition at line 806 of file storage.hpp.
|
inlineconstexpr |
Returns the effective flags.
Definition at line 917 of file storage.hpp.
|
inlineconstexpr |
Returns the pattern text.
Definition at line 909 of file storage.hpp.
|
inlinestaticconstexprprivate |
Copies the first N elements of v into a fixed array.
| T | Element type. |
| N | Exact size (measured from build). |
| Vec | Source container type. |
| [in] | source | The source vector. |
Definition at line 827 of file storage.hpp.
|
inlineconstexpr |
Returns a non-owning view of the compile-time program.
Definition at line 888 of file storage.hpp.
|
staticconstexpr |
Distinct class count.
Definition at line 841 of file storage.hpp.
|
staticconstexpr |
Interned classes.
Definition at line 848 of file storage.hpp.
|
staticconstexpr |
The program.
Definition at line 847 of file storage.hpp.
|
staticconstexpr |
Instruction count.
Definition at line 840 of file storage.hpp.
|
staticconstexpr |
Code-point class count (klass_cp).
Definition at line 843 of file storage.hpp.
|
staticconstexpr |
Code-point classes.
Definition at line 852 of file storage.hpp.
|
staticconstexpr |
Total code-point ranges.
Definition at line 844 of file storage.hpp.
|
staticconstexpr |
Flat range buffer.
Definition at line 854 of file storage.hpp.
|
staticconstexpr |
Flags merged with (?ims).
Definition at line 838 of file storage.hpp.
|
staticconstexpr |
Search hints.
Definition at line 839 of file storage.hpp.
|
staticconstexpr |
Selects the default constructor.
Definition at line 795 of file storage.hpp.
|
staticconstexpr |
Definition at line 864 of file storage.hpp.
|
staticconstexpr |
Named-group count.
Definition at line 842 of file storage.hpp.
|
staticconstexpr |
Named groups.
Definition at line 850 of file storage.hpp.
|
staticconstexpr |
2*(groups+1).
Definition at line 845 of file storage.hpp.