pub struct Match<'a> {
pub segment: u8,
pub nav: Nav,
pub node_type: NodeTypeIR,
pub node_field: Option<NonZeroU16>,
/* private fields */
}Expand description
Match instruction decoded from bytecode.
Provides iterator-based access to effects and successors without allocating.
Fields§
§segment: u8Segment index (0-3, currently only 0 is used).
Navigation command. Epsilon means no cursor movement or node check.
node_type: NodeTypeIRNode type constraint (Any = wildcard, Named/Anonymous for specific checks).
node_field: Option<NonZeroU16>Field constraint (None = wildcard).
Implementations§
Source§impl<'a> Match<'a>
impl<'a> Match<'a>
Sourcepub fn from_bytes(bytes: &'a [u8]) -> Self
pub fn from_bytes(bytes: &'a [u8]) -> Self
Parse a Match instruction from bytecode without allocating.
The slice must start at the instruction and contain at least the full instruction size (determined by opcode).
Header byte layout: segment(2) | node_kind(2) | opcode(4)
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Check if this is a terminal (accept) state.
Sourcepub fn is_epsilon(&self) -> bool
pub fn is_epsilon(&self) -> bool
Check if this is an epsilon transition (no node interaction).
Sourcepub fn succ_count(&self) -> usize
pub fn succ_count(&self) -> usize
Number of successors.
Sourcepub fn pre_effects(&self) -> impl Iterator<Item = EffectOp> + '_
pub fn pre_effects(&self) -> impl Iterator<Item = EffectOp> + '_
Iterate over pre-effects (executed before match attempt).
Sourcepub fn neg_fields(&self) -> impl Iterator<Item = u16> + '_
pub fn neg_fields(&self) -> impl Iterator<Item = u16> + '_
Iterate over negated fields (must NOT be present on matched node).
Sourcepub fn post_effects(&self) -> impl Iterator<Item = EffectOp> + '_
pub fn post_effects(&self) -> impl Iterator<Item = EffectOp> + '_
Iterate over post-effects (executed after successful match).
Sourcepub fn successors(&self) -> impl Iterator<Item = StepId> + '_
pub fn successors(&self) -> impl Iterator<Item = StepId> + '_
Iterate over successors.
Sourcepub fn has_predicate(&self) -> bool
pub fn has_predicate(&self) -> bool
Whether this instruction has a predicate (text filter).
Sourcepub fn predicate(&self) -> Option<(u8, bool, u16)>
pub fn predicate(&self) -> Option<(u8, bool, u16)>
Get predicate data if present: (op, is_regex, value_ref).
op: operator (0=Eq, 1=Ne, 2=StartsWith, 3=EndsWith, 4=Contains, 5=RegexMatch, 6=RegexNoMatch)is_regex: true if value_ref is a RegexTable index, false if StringTable indexvalue_ref: index into the appropriate table