diff options
-rw-r--r-- | MANIFEST | 3 | ||||
-rw-r--r-- | Makefile.SH | 2 | ||||
-rw-r--r-- | regcomp.h | 228 | ||||
-rw-r--r-- | regcomp.pl | 98 | ||||
-rw-r--r-- | regcomp.sym | 111 | ||||
-rw-r--r-- | regnodes.h | 250 |
6 files changed, 488 insertions, 204 deletions
@@ -723,8 +723,11 @@ qnx/ar QNX implementation of "ar" utility qnx/cpp QNX implementation of preprocessor filter regcomp.c Regular expression compiler regcomp.h Private declarations for above +regcomp.pl Builder of regnodes.h +regcomp.sym Data for regnodes.h regexec.c Regular expression evaluator regexp.h Public declarations for the above +regnodes.h Description of nodes of RE engine run.c The interpreter loop scope.c Scope entry and exit code scope.h Scope entry and exit header diff --git a/Makefile.SH b/Makefile.SH index 5150a22f1a..f2d9b8278b 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -450,6 +450,7 @@ SYMH = perlvars.h thrdvar.h # byterun.h: bytecode.pl # byterun.c: bytecode.pl # lib/B/Asmdata.pm: bytecode.pl +# regnodes.h: regcomp.pl # The correct versions should be already supplied with the perl kit, # in case you don't have perl available. # To force them to run, type @@ -459,6 +460,7 @@ regen_headers: FORCE perl opcode.pl perl embed.pl perl bytecode.pl + perl regcomp.pl # Extensions: # Names added to $(dynamic_ext) or $(static_ext) or $(nonxs_ext) will @@ -49,174 +49,6 @@ typedef OP OP_4tree; /* Will be redefined later. */ * to the thing following the set of BRANCHes.) The opcodes are: */ -/* definition number opnd? meaning */ -#define END 0 /* no End of program. */ -#define BOL 1 /* no Match "" at beginning of line. */ -#define MBOL 2 /* no Same, assuming multiline. */ -#define SBOL 3 /* no Same, assuming singleline. */ -#define EOL 4 /* no Match "" at end of line. */ -#define MEOL 5 /* no Same, assuming multiline. */ -#define SEOL 6 /* no Same, assuming singleline. */ -#define ANY 7 /* no Match any one character (except newline). */ -#define SANY 8 /* no Match any one character. */ -#define ANYOF 9 /* sv Match character in (or not in) this class. */ -#define CURLY 10 /* sv Match this simple thing {n,m} times. */ -#define CURLYX 11 /* sv Match this complex thing {n,m} times. */ -#define BRANCH 12 /* node Match this alternative, or the next... */ -#define BACK 13 /* no Match "", "next" ptr points backward. */ -#define EXACT 14 /* sv Match this string (preceded by length). */ -#define EXACTF 15 /* sv Match this string, folded (prec. by length). */ -#define EXACTFL 16 /* sv Match this string, folded in locale (w/len). */ -#define NOTHING 17 /* no Match empty string. */ -#define STAR 18 /* node Match this (simple) thing 0 or more times. */ -#define PLUS 19 /* node Match this (simple) thing 1 or more times. */ -#define BOUND 20 /* no Match "" at any word boundary */ -#define BOUNDL 21 /* no Match "" at any word boundary */ -#define NBOUND 22 /* no Match "" at any word non-boundary */ -#define NBOUNDL 23 /* no Match "" at any word non-boundary */ -#define REF 24 /* num Match some already matched string */ -#define OPEN 25 /* num Mark this point in input as start of #n. */ -#define CLOSE 26 /* num Analogous to OPEN. */ -#define MINMOD 27 /* no Next operator is not greedy. */ -#define GPOS 28 /* no Matches where last m//g left off. */ -#define IFMATCH 29 /* off Succeeds if the following matches. */ -#define UNLESSM 30 /* off Fails if the following matches. */ -#define SUCCEED 31 /* no Return from a subroutine, basically. */ -#define WHILEM 32 /* no Do curly processing and see if rest matches. */ -#define ALNUM 33 /* no Match any alphanumeric character */ -#define ALNUML 34 /* no Match any alphanumeric char in locale */ -#define NALNUM 35 /* no Match any non-alphanumeric character */ -#define NALNUML 36 /* no Match any non-alphanumeric char in locale */ -#define SPACE 37 /* no Match any whitespace character */ -#define SPACEL 38 /* no Match any whitespace char in locale */ -#define NSPACE 39 /* no Match any non-whitespace character */ -#define NSPACEL 40 /* no Match any non-whitespace char in locale */ -#define DIGIT 41 /* no Match any numeric character */ -#define NDIGIT 42 /* no Match any non-numeric character */ -#define CURLYM 43 /* no Match this medium-complex thing {n,m} times. */ -#define CURLYN 44 /* no Match next-after-this simple thing - {n,m} times, set parenths. */ -#define TAIL 45 /* no Match empty string. Can jump here from outside. */ -#define REFF 46 /* num Match already matched string, folded */ -#define REFFL 47 /* num Match already matched string, folded in loc. */ -#define EVAL 48 /* evl Execute some Perl code. */ -#define LONGJMP 49 /* off Jump far away. */ -#define BRANCHJ 50 /* off BRANCH with long offset. */ -#define IFTHEN 51 /* off Switch, should be preceeded by switcher . */ -#define GROUPP 52 /* num Whether the group matched. */ -#define LOGICAL 53 /* no Next opcode should set the flag only. */ -#define SUSPEND 54 /* off "Independent" sub-RE. */ -#define RENUM 55 /* off Group with independently numbered parens. */ -#define OPTIMIZED 56 /* off Placeholder for dump. */ - -/* - * Opcode notes: - * - * BRANCH The set of branches constituting a single choice are hooked - * together with their "next" pointers, since precedence prevents - * anything being concatenated to any individual branch. The - * "next" pointer of the last BRANCH in a choice points to the - * thing following the whole choice. This is also where the - * final "next" pointer of each individual branch points; each - * branch starts with the operand node of a BRANCH node. - * - * BACK Normal "next" pointers all implicitly point forward; BACK - * exists to make loop structures possible. - * - * STAR,PLUS '?', and complex '*' and '+', are implemented as circular - * BRANCH structures using BACK. Simple cases (one character - * per match) are implemented with STAR and PLUS for speed - * and to minimize recursive plunges. - * - * OPEN,CLOSE,GROUPP ...are numbered at compile time. - */ - -#ifndef DOINIT -EXTCONST U8 regkind[]; -#else -EXTCONST U8 regkind[] = { - END, - BOL, - BOL, - BOL, - EOL, - EOL, - EOL, - ANY, - ANY, - ANYOF, - CURLY, - CURLY, - BRANCH, - BACK, - EXACT, - EXACT, - EXACT, - NOTHING, - STAR, - PLUS, - BOUND, - BOUND, - NBOUND, - NBOUND, - REF, - OPEN, - CLOSE, - MINMOD, - GPOS, - BRANCHJ, - BRANCHJ, - END, - WHILEM, - ALNUM, - ALNUM, - NALNUM, - NALNUM, - SPACE, - SPACE, - NSPACE, - NSPACE, - DIGIT, - NDIGIT, - CURLY, - CURLY, - NOTHING, - REF, - REF, - EVAL, - LONGJMP, - BRANCHJ, - BRANCHJ, - GROUPP, - LOGICAL, - BRANCHJ, - BRANCHJ, - NOTHING, -}; -#endif - -/* The following have no fixed length. char* since we do strchr on it. */ -#ifndef DOINIT -EXTCONST char varies[]; -#else -EXTCONST char varies[] = { - BRANCH, BACK, STAR, PLUS, CURLY, CURLYX, REF, REFF, REFFL, - WHILEM, CURLYM, CURLYN, BRANCHJ, IFTHEN, SUSPEND, 0 -}; -#endif - -/* The following always have a length of 1. char* since we do strchr on it. */ -#ifndef DOINIT -EXTCONST char simple[]; -#else -EXTCONST char simple[] = { - ANY, SANY, ANYOF, - ALNUM, ALNUML, NALNUM, NALNUML, - SPACE, SPACEL, NSPACE, NSPACEL, - DIGIT, NDIGIT, 0 -}; -#endif - /* * A node is one char of opcode followed by two chars of "next" pointer. * "Next" pointers are stored as two 8-bit pieces, high order first. The @@ -359,44 +191,32 @@ struct regnode_2 { #define EXTRA_SIZE(guy) ((sizeof(guy)-1)/sizeof(struct regnode)) -#ifdef REG_COMP_C -const static U8 regarglen[] = { - 0,0,0,0,0,0,0,0,0,0, - /*CURLY*/ EXTRA_SIZE(struct regnode_2), - /*CURLYX*/ EXTRA_SIZE(struct regnode_2), - 0,0,0,0,0,0,0,0,0,0,0,0, - /*REF*/ EXTRA_SIZE(struct regnode_1), - /*OPEN*/ EXTRA_SIZE(struct regnode_1), - /*CLOSE*/ EXTRA_SIZE(struct regnode_1), - 0,0, - /*IFMATCH*/ EXTRA_SIZE(struct regnode_1), - /*UNLESSM*/ EXTRA_SIZE(struct regnode_1), - 0,0,0,0,0,0,0,0,0,0,0,0, - /*CURLYM*/ EXTRA_SIZE(struct regnode_2), - /*CURLYN*/ EXTRA_SIZE(struct regnode_2), - 0, - /*REFF*/ EXTRA_SIZE(struct regnode_1), - /*REFFL*/ EXTRA_SIZE(struct regnode_1), - /*EVAL*/ EXTRA_SIZE(struct regnode_1), - /*LONGJMP*/ EXTRA_SIZE(struct regnode_1), - /*BRANCHJ*/ EXTRA_SIZE(struct regnode_1), - /*IFTHEN*/ EXTRA_SIZE(struct regnode_1), - /*GROUPP*/ EXTRA_SIZE(struct regnode_1), - /*LOGICAL*/ 0, - /*SUSPEND*/ EXTRA_SIZE(struct regnode_1), - /*RENUM*/ EXTRA_SIZE(struct regnode_1), 0, +#define REG_SEEN_ZERO_LEN 1 +#define REG_SEEN_LOOKBEHIND 2 +#define REG_SEEN_GPOS 4 +#define REG_SEEN_EVAL 8 + +#include "regnodes.h" + +/* The following have no fixed length. char* since we do strchr on it. */ +#ifndef DOINIT +EXTCONST char varies[]; +#else +EXTCONST char varies[] = { + BRANCH, BACK, STAR, PLUS, CURLY, CURLYX, REF, REFF, REFFL, + WHILEM, CURLYM, CURLYN, BRANCHJ, IFTHEN, SUSPEND, 0 }; +#endif -const static char reg_off_by_arg[] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0 .. 15 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0, /*IFMATCH*/ 2, /*UNLESSM*/ 2, 0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 32 .. 47 */ - 0, /*LONGJMP*/ 1, /*BRANCHJ*/ 1, /*IFTHEN*/ 1, 0, 0, - /*RENUM*/ 1, /*RENUM*/ 1,0, +/* The following always have a length of 1. char* since we do strchr on it. */ +#ifndef DOINIT +EXTCONST char simple[]; +#else +EXTCONST char simple[] = { + ANY, SANY, ANYOF, + ALNUM, ALNUML, NALNUM, NALNUML, + SPACE, SPACEL, NSPACE, NSPACEL, + DIGIT, NDIGIT, 0 }; #endif -#define REG_SEEN_ZERO_LEN 1 -#define REG_SEEN_LOOKBEHIND 2 -#define REG_SEEN_GPOS 4 -#define REG_SEEN_EVAL 8 diff --git a/regcomp.pl b/regcomp.pl new file mode 100644 index 0000000000..cfe59adc22 --- /dev/null +++ b/regcomp.pl @@ -0,0 +1,98 @@ +#use Fatal qw(open close rename chmod unlink); +open DESC, 'regcomp.sym'; +$ind = 0; + +while (<DESC>) { + next if /^\s*($|\#)/; + $ind++; + chomp; + ($name[$ind], $desc, $rest[$ind]) = split /\t+/, $_, 3; + ($type[$ind], $code[$ind], $args[$ind], $longj[$ind]) + = split /[,\s]\s*/, $desc, 4; +} +close DESC; +$tot = $ind; + +$tmp_h = 'tmp_reg.h'; + +unlink $tmp_h if -f $tmp_h; + +open OUT, ">$tmp_h"; + +print OUT <<EOP; +/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!! + This file is built by regcomp.pl from regcomp.sym. + Any changes made here will be lost! +*/ + +EOP + +$ind = 0; +while (++$ind <= $tot) { + $oind = $ind - 1; + $hind = sprintf "%#4x", $oind; + print OUT <<EOP; +#define $name[$ind] $oind /* $hind $rest[$ind] */ +EOP +} + +print OUT <<EOP; + +#ifndef DOINIT +EXTCONST U8 regkind[]; +#else +EXTCONST U8 regkind[] = { +EOP + +$ind = 0; +while (++$ind <= $tot) { + print OUT <<EOP; + $type[$ind], /* $name[$ind] */ +EOP +} + +print OUT <<EOP; +}; +#endif + + +#ifdef REG_COMP_C +const static U8 regarglen[] = { +EOP + +$ind = 0; +while (++$ind <= $tot) { + $size = 0; + $size = "EXTRA_SIZE(struct regnode_$args[$ind])" if $args[$ind]; + + print OUT <<EOP; + $size, /* $name[$ind] */ +EOP +} + +print OUT <<EOP; +}; + +const static char reg_off_by_arg[] = { +EOP + +$ind = 0; +while (++$ind <= $tot) { + $size = $longj[$ind] || 0; + + print OUT <<EOP; + $size, /* $name[$ind] */ +EOP +} + +print OUT <<EOP; +}; +#endif /* REG_COMP_C */ + +EOP + +close OUT; + +chmod 0666, 'regnodes.h'; +unlink 'regnodes.h'; +rename $tmp_h, 'regnodes.h'; diff --git a/regcomp.sym b/regcomp.sym new file mode 100644 index 0000000000..aa18d119cc --- /dev/null +++ b/regcomp.sym @@ -0,0 +1,111 @@ +# Format: +# NAME \t TYPE, arg-description [num-args] [longjump-len] \t DESCRIPTION + +# Empty rows and #-comment rows are ignored. + +# Exit points +END END, no End of program. +SUCCEED END, no Return from a subroutine, basically. + +# Anchors: +BOL BOL, no Match "" at beginning of line. +MBOL BOL, no Same, assuming multiline. +SBOL BOL, no Same, assuming singleline. +EOL EOL, no Match "" at end of line. +MEOL EOL, no Same, assuming multiline. +SEOL EOL, no Same, assuming singleline. +BOUND BOUND, no Match "" at any word boundary +BOUNDL BOUND, no Match "" at any word boundary +NBOUND NBOUND, no Match "" at any word non-boundary +NBOUNDL NBOUND, no Match "" at any word non-boundary +GPOS GPOS, no Matches where last m//g left off. + +# [Special] alternatives +ANY ANY, no Match any one character (except newline). +SANY ANY, no Match any one character. +ANYOF ANYOF, sv Match character in (or not in) this class. +ALNUM ALNUM, no Match any alphanumeric character +ALNUML ALNUM, no Match any alphanumeric char in locale +NALNUM NALNUM, no Match any non-alphanumeric character +NALNUML NALNUM, no Match any non-alphanumeric char in locale +SPACE SPACE, no Match any whitespace character +SPACEL SPACE, no Match any whitespace char in locale +NSPACE NSPACE, no Match any non-whitespace character +NSPACEL NSPACE, no Match any non-whitespace char in locale +DIGIT DIGIT, no Match any numeric character +NDIGIT NDIGIT, no Match any non-numeric character + +# BRANCH The set of branches constituting a single choice are hooked +# together with their "next" pointers, since precedence prevents +# anything being concatenated to any individual branch. The +# "next" pointer of the last BRANCH in a choice points to the +# thing following the whole choice. This is also where the +# final "next" pointer of each individual branch points; each +# branch starts with the operand node of a BRANCH node. +# +BRANCH BRANCH, node Match this alternative, or the next... + +# BACK Normal "next" pointers all implicitly point forward; BACK +# exists to make loop structures possible. +# not used +BACK BACK, no Match "", "next" ptr points backward. + +# Literals +EXACT EXACT, sv Match this string (preceded by length). +EXACTF EXACT, sv Match this string, folded (prec. by length). +EXACTFL EXACT, sv Match this string, folded in locale (w/len). + +# Do nothing +NOTHING NOTHING,no Match empty string. +# A variant of above which delimits a group, thus stops optimizations +TAIL NOTHING,no Match empty string. Can jump here from outside. + +# STAR,PLUS '?', and complex '*' and '+', are implemented as circular +# BRANCH structures using BACK. Simple cases (one character +# per match) are implemented with STAR and PLUS for speed +# and to minimize recursive plunges. +# +STAR STAR, node Match this (simple) thing 0 or more times. +PLUS PLUS, node Match this (simple) thing 1 or more times. + +CURLY CURLY, sv 2 Match this simple thing {n,m} times. +CURLYN CURLY, no 2 Match next-after-this simple thing +# {n,m} times, set parenths. +CURLYM CURLY, no 2 Match this medium-complex thing {n,m} times. +CURLYX CURLY, sv 2 Match this complex thing {n,m} times. + +# This terminator creates a loop structure for CURLYX +WHILEM WHILEM, no Do curly processing and see if rest matches. + +# OPEN,CLOSE,GROUPP ...are numbered at compile time. +OPEN OPEN, num 1 Mark this point in input as start of #n. +CLOSE CLOSE, num 1 Analogous to OPEN. + +REF REF, num 1 Match some already matched string +REFF REF, num 1 Match already matched string, folded +REFFL REF, num 1 Match already matched string, folded in loc. + +# grouping assertions +IFMATCH BRANCHJ,off 1 2 Succeeds if the following matches. +UNLESSM BRANCHJ,off 1 2 Fails if the following matches. +SUSPEND BRANCHJ,off 1 1 "Independent" sub-RE. +IFTHEN BRANCHJ,off 1 1 Switch, should be preceeded by switcher . +GROUPP GROUPP, num 1 Whether the group matched. + +# Support for long RE +LONGJMP LONGJMP,off 1 1 Jump far away. +BRANCHJ BRANCHJ,off 1 1 BRANCH with long offset. + +# The heavy worker +EVAL EVAL, evl 1 Execute some Perl code. + +# Modifiers +MINMOD MINMOD, no Next operator is not greedy. +LOGICAL LOGICAL,no Next opcode should set the flag only. + +# This is not used yet +RENUM BRANCHJ,off 1 1 Group with independently numbered parens. + +# This is not really a node, but an optimized away piece of a "long" node. +# To simplify debugging output, we mark it as if it were a node +OPTIMIZED NOTHING,off Placeholder for dump. diff --git a/regnodes.h b/regnodes.h new file mode 100644 index 0000000000..445d0b2803 --- /dev/null +++ b/regnodes.h @@ -0,0 +1,250 @@ +/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!! + This file is built by regcomp.pl from regcomp.sym. + Any changes made here will be lost! +*/ + +#define END 0 /* 0 End of program. */ +#define SUCCEED 1 /* 0x1 Return from a subroutine, basically. */ +#define BOL 2 /* 0x2 Match "" at beginning of line. */ +#define MBOL 3 /* 0x3 Same, assuming multiline. */ +#define SBOL 4 /* 0x4 Same, assuming singleline. */ +#define EOL 5 /* 0x5 Match "" at end of line. */ +#define MEOL 6 /* 0x6 Same, assuming multiline. */ +#define SEOL 7 /* 0x7 Same, assuming singleline. */ +#define BOUND 8 /* 0x8 Match "" at any word boundary */ +#define BOUNDL 9 /* 0x9 Match "" at any word boundary */ +#define NBOUND 10 /* 0xa Match "" at any word non-boundary */ +#define NBOUNDL 11 /* 0xb Match "" at any word non-boundary */ +#define GPOS 12 /* 0xc Matches where last m//g left off. */ +#define ANY 13 /* 0xd Match any one character (except newline). */ +#define SANY 14 /* 0xe Match any one character. */ +#define ANYOF 15 /* 0xf Match character in (or not in) this class. */ +#define ALNUM 16 /* 0x10 Match any alphanumeric character */ +#define ALNUML 17 /* 0x11 Match any alphanumeric char in locale */ +#define NALNUM 18 /* 0x12 Match any non-alphanumeric character */ +#define NALNUML 19 /* 0x13 Match any non-alphanumeric char in locale */ +#define SPACE 20 /* 0x14 Match any whitespace character */ +#define SPACEL 21 /* 0x15 Match any whitespace char in locale */ +#define NSPACE 22 /* 0x16 Match any non-whitespace character */ +#define NSPACEL 23 /* 0x17 Match any non-whitespace char in locale */ +#define DIGIT 24 /* 0x18 Match any numeric character */ +#define NDIGIT 25 /* 0x19 Match any non-numeric character */ +#define BRANCH 26 /* 0x1a Match this alternative, or the next... */ +#define BACK 27 /* 0x1b Match "", "next" ptr points backward. */ +#define EXACT 28 /* 0x1c Match this string (preceded by length). */ +#define EXACTF 29 /* 0x1d Match this string, folded (prec. by length). */ +#define EXACTFL 30 /* 0x1e Match this string, folded in locale (w/len). */ +#define NOTHING 31 /* 0x1f Match empty string. */ +#define TAIL 32 /* 0x20 Match empty string. Can jump here from outside. */ +#define STAR 33 /* 0x21 Match this (simple) thing 0 or more times. */ +#define PLUS 34 /* 0x22 Match this (simple) thing 1 or more times. */ +#define CURLY 35 /* 0x23 Match this simple thing {n,m} times. */ +#define CURLYN 36 /* 0x24 Match next-after-this simple thing */ +#define CURLYM 37 /* 0x25 Match this medium-complex thing {n,m} times. */ +#define CURLYX 38 /* 0x26 Match this complex thing {n,m} times. */ +#define WHILEM 39 /* 0x27 Do curly processing and see if rest matches. */ +#define OPEN 40 /* 0x28 Mark this point in input as start of #n. */ +#define CLOSE 41 /* 0x29 Analogous to OPEN. */ +#define REF 42 /* 0x2a Match some already matched string */ +#define REFF 43 /* 0x2b Match already matched string, folded */ +#define REFFL 44 /* 0x2c Match already matched string, folded in loc. */ +#define IFMATCH 45 /* 0x2d Succeeds if the following matches. */ +#define UNLESSM 46 /* 0x2e Fails if the following matches. */ +#define SUSPEND 47 /* 0x2f "Independent" sub-RE. */ +#define IFTHEN 48 /* 0x30 Switch, should be preceeded by switcher . */ +#define GROUPP 49 /* 0x31 Whether the group matched. */ +#define LONGJMP 50 /* 0x32 Jump far away. */ +#define BRANCHJ 51 /* 0x33 BRANCH with long offset. */ +#define EVAL 52 /* 0x34 Execute some Perl code. */ +#define MINMOD 53 /* 0x35 Next operator is not greedy. */ +#define LOGICAL 54 /* 0x36 Next opcode should set the flag only. */ +#define RENUM 55 /* 0x37 Group with independently numbered parens. */ +#define OPTIMIZED 56 /* 0x38 Placeholder for dump. */ + +#ifndef DOINIT +EXTCONST U8 regkind[]; +#else +EXTCONST U8 regkind[] = { + END, /* END */ + END, /* SUCCEED */ + BOL, /* BOL */ + BOL, /* MBOL */ + BOL, /* SBOL */ + EOL, /* EOL */ + EOL, /* MEOL */ + EOL, /* SEOL */ + BOUND, /* BOUND */ + BOUND, /* BOUNDL */ + NBOUND, /* NBOUND */ + NBOUND, /* NBOUNDL */ + GPOS, /* GPOS */ + ANY, /* ANY */ + ANY, /* SANY */ + ANYOF, /* ANYOF */ + ALNUM, /* ALNUM */ + ALNUM, /* ALNUML */ + NALNUM, /* NALNUM */ + NALNUM, /* NALNUML */ + SPACE, /* SPACE */ + SPACE, /* SPACEL */ + NSPACE, /* NSPACE */ + NSPACE, /* NSPACEL */ + DIGIT, /* DIGIT */ + NDIGIT, /* NDIGIT */ + BRANCH, /* BRANCH */ + BACK, /* BACK */ + EXACT, /* EXACT */ + EXACT, /* EXACTF */ + EXACT, /* EXACTFL */ + NOTHING, /* NOTHING */ + NOTHING, /* TAIL */ + STAR, /* STAR */ + PLUS, /* PLUS */ + CURLY, /* CURLY */ + CURLY, /* CURLYN */ + CURLY, /* CURLYM */ + CURLY, /* CURLYX */ + WHILEM, /* WHILEM */ + OPEN, /* OPEN */ + CLOSE, /* CLOSE */ + REF, /* REF */ + REF, /* REFF */ + REF, /* REFFL */ + BRANCHJ, /* IFMATCH */ + BRANCHJ, /* UNLESSM */ + BRANCHJ, /* SUSPEND */ + BRANCHJ, /* IFTHEN */ + GROUPP, /* GROUPP */ + LONGJMP, /* LONGJMP */ + BRANCHJ, /* BRANCHJ */ + EVAL, /* EVAL */ + MINMOD, /* MINMOD */ + LOGICAL, /* LOGICAL */ + BRANCHJ, /* RENUM */ + NOTHING, /* OPTIMIZED */ +}; +#endif + + +#ifdef REG_COMP_C +const static U8 regarglen[] = { + 0, /* END */ + 0, /* SUCCEED */ + 0, /* BOL */ + 0, /* MBOL */ + 0, /* SBOL */ + 0, /* EOL */ + 0, /* MEOL */ + 0, /* SEOL */ + 0, /* BOUND */ + 0, /* BOUNDL */ + 0, /* NBOUND */ + 0, /* NBOUNDL */ + 0, /* GPOS */ + 0, /* ANY */ + 0, /* SANY */ + 0, /* ANYOF */ + 0, /* ALNUM */ + 0, /* ALNUML */ + 0, /* NALNUM */ + 0, /* NALNUML */ + 0, /* SPACE */ + 0, /* SPACEL */ + 0, /* NSPACE */ + 0, /* NSPACEL */ + 0, /* DIGIT */ + 0, /* NDIGIT */ + 0, /* BRANCH */ + 0, /* BACK */ + 0, /* EXACT */ + 0, /* EXACTF */ + 0, /* EXACTFL */ + 0, /* NOTHING */ + 0, /* TAIL */ + 0, /* STAR */ + 0, /* PLUS */ + EXTRA_SIZE(struct regnode_2), /* CURLY */ + EXTRA_SIZE(struct regnode_2), /* CURLYN */ + EXTRA_SIZE(struct regnode_2), /* CURLYM */ + EXTRA_SIZE(struct regnode_2), /* CURLYX */ + 0, /* WHILEM */ + EXTRA_SIZE(struct regnode_1), /* OPEN */ + EXTRA_SIZE(struct regnode_1), /* CLOSE */ + EXTRA_SIZE(struct regnode_1), /* REF */ + EXTRA_SIZE(struct regnode_1), /* REFF */ + EXTRA_SIZE(struct regnode_1), /* REFFL */ + EXTRA_SIZE(struct regnode_1), /* IFMATCH */ + EXTRA_SIZE(struct regnode_1), /* UNLESSM */ + EXTRA_SIZE(struct regnode_1), /* SUSPEND */ + EXTRA_SIZE(struct regnode_1), /* IFTHEN */ + EXTRA_SIZE(struct regnode_1), /* GROUPP */ + EXTRA_SIZE(struct regnode_1), /* LONGJMP */ + EXTRA_SIZE(struct regnode_1), /* BRANCHJ */ + EXTRA_SIZE(struct regnode_1), /* EVAL */ + 0, /* MINMOD */ + 0, /* LOGICAL */ + EXTRA_SIZE(struct regnode_1), /* RENUM */ + 0, /* OPTIMIZED */ +}; + +const static char reg_off_by_arg[] = { + 0, /* END */ + 0, /* SUCCEED */ + 0, /* BOL */ + 0, /* MBOL */ + 0, /* SBOL */ + 0, /* EOL */ + 0, /* MEOL */ + 0, /* SEOL */ + 0, /* BOUND */ + 0, /* BOUNDL */ + 0, /* NBOUND */ + 0, /* NBOUNDL */ + 0, /* GPOS */ + 0, /* ANY */ + 0, /* SANY */ + 0, /* ANYOF */ + 0, /* ALNUM */ + 0, /* ALNUML */ + 0, /* NALNUM */ + 0, /* NALNUML */ + 0, /* SPACE */ + 0, /* SPACEL */ + 0, /* NSPACE */ + 0, /* NSPACEL */ + 0, /* DIGIT */ + 0, /* NDIGIT */ + 0, /* BRANCH */ + 0, /* BACK */ + 0, /* EXACT */ + 0, /* EXACTF */ + 0, /* EXACTFL */ + 0, /* NOTHING */ + 0, /* TAIL */ + 0, /* STAR */ + 0, /* PLUS */ + 0, /* CURLY */ + 0, /* CURLYN */ + 0, /* CURLYM */ + 0, /* CURLYX */ + 0, /* WHILEM */ + 0, /* OPEN */ + 0, /* CLOSE */ + 0, /* REF */ + 0, /* REFF */ + 0, /* REFFL */ + 2, /* IFMATCH */ + 2, /* UNLESSM */ + 1, /* SUSPEND */ + 1, /* IFTHEN */ + 0, /* GROUPP */ + 1, /* LONGJMP */ + 1, /* BRANCHJ */ + 0, /* EVAL */ + 0, /* MINMOD */ + 0, /* LOGICAL */ + 1, /* RENUM */ + 0, /* OPTIMIZED */ +}; +#endif /* REG_COMP_C */ + |