NAME
regen/regcomp.pl - generate regex node metadata from regcomp.sym
DESCRIPTION
This file is the canonical Perl-data source consumed by regen/regcomp.pl. It defines the regex opcodes and regmatch states used to generate regnodes.h and the regnode table in pod/perlreguts.pod.
Order is significant. Preserve the existing order of groups and the order of entries within each group unless you are intentionally changing regex opcode or state numbering semantics.
TOP-LEVEL STRUCTURE
The file returns a single hashref with these keys:
ops_groupsAn ordered arrayref of opcode groups.
state_groupsAn ordered arrayref of state groups.
OPCODE GROUPS
Each entry in ops_groups is a hashref with:
GROUPThe logical group/block name. Groups are emitted as blocks, so relative ordering within a group is preserved.
TYPEThe regnode type shared by the group. This may be a string type name, an arrayref of types, or a special value
"__MIXED__", which allows the type to contain ops of any type without validation.podOptional text emitted into the generated regnode table in pod/perlreguts.pod. A scalar is one paragraph. An arrayref of strings is one paragraph which will be reflowed. A nested arrayref starts a new paragraph; only two levels are supported.
commentOptional maintainer-facing notes about ordering, invariants, or implementation constraints.
opsAn ordered arrayref of opcode definitions.
Each regop definition may contain:
NAMEThe opcode name.
TYPEOptional unless the containing group's
TYPEis__MIXED__. If the group is not mixed, the containing group'sTYPEis the default and any provided opcodeTYPEmust match it. If the group is mixed, each opcode must provide its ownTYPE.descDescription of what the regop does. It follows the same scalar/arrayref paragraph rules as
pod.structOptional regnode structure name such as
regnode_1orregnode_charclass. Omit it for plainregnode.podOptional per-op text which is intended to be emitted into the generated regnode table in perlreguts.pod. It follows the same scalar/arrayref paragraph rules as group-level
pod.commentOptional maintainer-facing notes for this op.
attrOptional hashref of non-default attributes. Recognized keys currently include
arg_spec,simple,varies,off_by_arg, andstr_arg.
STATE GROUPS
Each entry in state_groups is a hashref with:
TYPEThe base opcode/state name used to form the generated state names.
transitionsThe compact transition specification used to expand regmatch states.
podOptional text emitted into the generated regnode table. It follows the same scalar/arrayref paragraph rules as opcode-group
pod.commentOptional maintainer-facing notes.
NOTES
The pod and comment fields serve different purposes. pod is for generated documentation output; comment is for source-maintainer guidance, we put the latter in the data structure so it can be regenerated via code if necessary.