libsnobol4 1.0.2
High-performance SNOBOL4-style pattern matching library
Loading...
Searching...
No Matches
search_vm_t Struct Reference

Lightweight VM state for search-mode execution (Tier 1-7). More...

#include <vm.h>

Collaboration diagram for search_vm_t:

Public Attributes

const uint8_t * bc
size_t bc_len
const char * s
size_t len
size_t ip
size_t pos
const snobol_range_meta_t * range_meta
size_t range_meta_count
void * choices
size_t choices_cap
size_t choices_top
bool use_compact_choice
uint32_t counters [MAX_LOOPS]
uint32_t loop_min [MAX_LOOPS]
uint32_t loop_max [MAX_LOOPS]
size_t loop_last_pos [MAX_LOOPS]
uint8_t max_counter_used
size_t cap_start [MAX_CAPS]
size_t cap_end [MAX_CAPS]
uint8_t max_cap_used
size_t var_start [MAX_VARS]
size_t var_end [MAX_VARS]
size_t var_count

Detailed Description

Lightweight VM state for search-mode execution (Tier 1-7).

Contains only the fields needed by the search-VM, DFA, and specialized accelerator tiers. Tier 6 (capture-aware search-VM) uses capture, variable, and choice-stack fields; lower tiers use only bc/ip/pos.

Size target: ≤1.6 KB (vs ~2.5 KB for full VM) after adding capture and variable registers.

Definition at line 612 of file vm.h.

Member Data Documentation

◆ bc

const uint8_t* search_vm_t::bc

Compiled bytecode pointer (not owned).

Definition at line 613 of file vm.h.

◆ bc_len

size_t search_vm_t::bc_len

Bytecode length in bytes.

Definition at line 614 of file vm.h.

◆ cap_end

size_t search_vm_t::cap_end[MAX_CAPS]

Definition at line 641 of file vm.h.

◆ cap_start

size_t search_vm_t::cap_start[MAX_CAPS]

Definition at line 640 of file vm.h.

◆ choices

void* search_vm_t::choices

Definition at line 627 of file vm.h.

◆ choices_cap

size_t search_vm_t::choices_cap

Definition at line 628 of file vm.h.

◆ choices_top

size_t search_vm_t::choices_top

Definition at line 629 of file vm.h.

◆ counters

uint32_t search_vm_t::counters[MAX_LOOPS]

Definition at line 633 of file vm.h.

◆ ip

size_t search_vm_t::ip

Instruction pointer.

Definition at line 619 of file vm.h.

◆ len

size_t search_vm_t::len

Remaining subject length (subject_len - offset).

Definition at line 617 of file vm.h.

◆ loop_last_pos

size_t search_vm_t::loop_last_pos[MAX_LOOPS]

Definition at line 636 of file vm.h.

◆ loop_max

uint32_t search_vm_t::loop_max[MAX_LOOPS]

Definition at line 635 of file vm.h.

◆ loop_min

uint32_t search_vm_t::loop_min[MAX_LOOPS]

Definition at line 634 of file vm.h.

◆ max_cap_used

uint8_t search_vm_t::max_cap_used

Definition at line 642 of file vm.h.

◆ max_counter_used

uint8_t search_vm_t::max_counter_used

Definition at line 637 of file vm.h.

◆ pos

size_t search_vm_t::pos

Subject byte position.

Definition at line 620 of file vm.h.

◆ range_meta

const snobol_range_meta_t* search_vm_t::range_meta

Cached charclass range metadata (set_id -> range data).

Definition at line 623 of file vm.h.

◆ range_meta_count

size_t search_vm_t::range_meta_count

Definition at line 624 of file vm.h.

◆ s

const char* search_vm_t::s

Subject string pointer (adjusted by offset).

Definition at line 616 of file vm.h.

◆ use_compact_choice

bool search_vm_t::use_compact_choice

Definition at line 630 of file vm.h.

◆ var_count

size_t search_vm_t::var_count

Definition at line 647 of file vm.h.

◆ var_end

size_t search_vm_t::var_end[MAX_VARS]

Definition at line 646 of file vm.h.

◆ var_start

size_t search_vm_t::var_start[MAX_VARS]

Definition at line 645 of file vm.h.


The documentation for this struct was generated from the following file:
  • core/include/snobol/vm.h