summaryrefslogtreecommitdiff
path: root/regnodes.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2006-10-06 21:16:01 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-10-07 14:30:32 +0000
commit81714fb9c03d91d66b66cab6e899e81bf64a2ca7 (patch)
tree40861dec0355f417fff2a7ff3c393082960066cc /regnodes.h
parentf5def3a2a0d8913110936f9f4e13e37835754c28 (diff)
downloadperl-81714fb9c03d91d66b66cab6e899e81bf64a2ca7.tar.gz
Re: [PATCH] Initial attempt at named captures for perls regexp engine
Message-ID: <9b18b3110610061016x5ddce965u30d9a821f632d450@mail.gmail.com> p4raw-id: //depot/perl@28957
Diffstat (limited to 'regnodes.h')
-rw-r--r--regnodes.h147
1 files changed, 81 insertions, 66 deletions
diff --git a/regnodes.h b/regnodes.h
index 78db033020..3030e04684 100644
--- a/regnodes.h
+++ b/regnodes.h
@@ -6,8 +6,8 @@
/* Regops and State definitions */
-#define REGNODE_MAX 68
-#define REGMATCH_STATE_MAX 98
+#define REGNODE_MAX 71
+#define REGMATCH_STATE_MAX 101
#define END 0 /* 0000 End of program. */
#define SUCCEED 1 /* 0x01 Return from a subroutine, basically. */
@@ -76,41 +76,44 @@
#define AHOCORASICKC 64 /* 0x40 Same as AHOCORASICK, but with embedded charclass data */
#define RECURSE 65 /* 0x41 recurse to paren arg1 at (signed) ofs arg2 */
#define SRECURSE 66 /* 0x42 recurse to start of pattern */
-#define OPTIMIZED 67 /* 0x43 Placeholder for dump. */
-#define PSEUDO 68 /* 0x44 Pseudo opcode for internal use. */
+#define NREF 67 /* 0x43 Match some already matched string */
+#define NREFF 68 /* 0x44 Match already matched string, folded */
+#define NREFFL 69 /* 0x45 Match already matched string, folded in loc. */
+#define OPTIMIZED 70 /* 0x46 Placeholder for dump. */
+#define PSEUDO 71 /* 0x47 Pseudo opcode for internal use. */
/* ------------ States ------------- */
-#define TRIE_next 69 /* 0x45 Regmatch state for TRIE */
-#define TRIE_next_fail 70 /* 0x46 Regmatch state for TRIE */
-#define EVAL_AB 71 /* 0x47 Regmatch state for EVAL */
-#define EVAL_AB_fail 72 /* 0x48 Regmatch state for EVAL */
-#define CURLYX_end 73 /* 0x49 Regmatch state for CURLYX */
-#define CURLYX_end_fail 74 /* 0x4a Regmatch state for CURLYX */
-#define WHILEM_A_pre 75 /* 0x4b Regmatch state for WHILEM */
-#define WHILEM_A_pre_fail 76 /* 0x4c Regmatch state for WHILEM */
-#define WHILEM_A_min 77 /* 0x4d Regmatch state for WHILEM */
-#define WHILEM_A_min_fail 78 /* 0x4e Regmatch state for WHILEM */
-#define WHILEM_A_max 79 /* 0x4f Regmatch state for WHILEM */
-#define WHILEM_A_max_fail 80 /* 0x50 Regmatch state for WHILEM */
-#define WHILEM_B_min 81 /* 0x51 Regmatch state for WHILEM */
-#define WHILEM_B_min_fail 82 /* 0x52 Regmatch state for WHILEM */
-#define WHILEM_B_max 83 /* 0x53 Regmatch state for WHILEM */
-#define WHILEM_B_max_fail 84 /* 0x54 Regmatch state for WHILEM */
-#define BRANCH_next 85 /* 0x55 Regmatch state for BRANCH */
-#define BRANCH_next_fail 86 /* 0x56 Regmatch state for BRANCH */
-#define CURLYM_A 87 /* 0x57 Regmatch state for CURLYM */
-#define CURLYM_A_fail 88 /* 0x58 Regmatch state for CURLYM */
-#define CURLYM_B 89 /* 0x59 Regmatch state for CURLYM */
-#define CURLYM_B_fail 90 /* 0x5a Regmatch state for CURLYM */
-#define IFMATCH_A 91 /* 0x5b Regmatch state for IFMATCH */
-#define IFMATCH_A_fail 92 /* 0x5c Regmatch state for IFMATCH */
-#define CURLY_B_min_known 93 /* 0x5d Regmatch state for CURLY */
-#define CURLY_B_min_known_fail 94 /* 0x5e Regmatch state for CURLY */
-#define CURLY_B_min 95 /* 0x5f Regmatch state for CURLY */
-#define CURLY_B_min_fail 96 /* 0x60 Regmatch state for CURLY */
-#define CURLY_B_max 97 /* 0x61 Regmatch state for CURLY */
-#define CURLY_B_max_fail 98 /* 0x62 Regmatch state for CURLY */
+#define TRIE_next 72 /* 0x48 Regmatch state for TRIE */
+#define TRIE_next_fail 73 /* 0x49 Regmatch state for TRIE */
+#define EVAL_AB 74 /* 0x4a Regmatch state for EVAL */
+#define EVAL_AB_fail 75 /* 0x4b Regmatch state for EVAL */
+#define CURLYX_end 76 /* 0x4c Regmatch state for CURLYX */
+#define CURLYX_end_fail 77 /* 0x4d Regmatch state for CURLYX */
+#define WHILEM_A_pre 78 /* 0x4e Regmatch state for WHILEM */
+#define WHILEM_A_pre_fail 79 /* 0x4f Regmatch state for WHILEM */
+#define WHILEM_A_min 80 /* 0x50 Regmatch state for WHILEM */
+#define WHILEM_A_min_fail 81 /* 0x51 Regmatch state for WHILEM */
+#define WHILEM_A_max 82 /* 0x52 Regmatch state for WHILEM */
+#define WHILEM_A_max_fail 83 /* 0x53 Regmatch state for WHILEM */
+#define WHILEM_B_min 84 /* 0x54 Regmatch state for WHILEM */
+#define WHILEM_B_min_fail 85 /* 0x55 Regmatch state for WHILEM */
+#define WHILEM_B_max 86 /* 0x56 Regmatch state for WHILEM */
+#define WHILEM_B_max_fail 87 /* 0x57 Regmatch state for WHILEM */
+#define BRANCH_next 88 /* 0x58 Regmatch state for BRANCH */
+#define BRANCH_next_fail 89 /* 0x59 Regmatch state for BRANCH */
+#define CURLYM_A 90 /* 0x5a Regmatch state for CURLYM */
+#define CURLYM_A_fail 91 /* 0x5b Regmatch state for CURLYM */
+#define CURLYM_B 92 /* 0x5c Regmatch state for CURLYM */
+#define CURLYM_B_fail 93 /* 0x5d Regmatch state for CURLYM */
+#define IFMATCH_A 94 /* 0x5e Regmatch state for IFMATCH */
+#define IFMATCH_A_fail 95 /* 0x5f Regmatch state for IFMATCH */
+#define CURLY_B_min_known 96 /* 0x60 Regmatch state for CURLY */
+#define CURLY_B_min_known_fail 97 /* 0x61 Regmatch state for CURLY */
+#define CURLY_B_min 98 /* 0x62 Regmatch state for CURLY */
+#define CURLY_B_min_fail 99 /* 0x63 Regmatch state for CURLY */
+#define CURLY_B_max 100 /* 0x64 Regmatch state for CURLY */
+#define CURLY_B_max_fail 101 /* 0x65 Regmatch state for CURLY */
/* PL_regkind[] What type of regop or state is this. */
@@ -185,6 +188,9 @@ EXTCONST U8 PL_regkind[] = {
TRIE, /* AHOCORASICKC */
RECURSE, /* RECURSE */
RECURSE, /* SRECURSE */
+ NREF, /* NREF */
+ NREF, /* NREFF */
+ NREF, /* NREFFL */
NOTHING, /* OPTIMIZED */
PSEUDO, /* PSEUDO */
/* ------------ States ------------- */
@@ -292,6 +298,9 @@ static const U8 regarglen[] = {
EXTRA_SIZE(struct regnode_charclass), /* AHOCORASICKC */
EXTRA_SIZE(struct regnode_2L), /* RECURSE */
0, /* SRECURSE */
+ EXTRA_SIZE(struct regnode_1), /* NREF */
+ EXTRA_SIZE(struct regnode_1), /* NREFF */
+ EXTRA_SIZE(struct regnode_1), /* NREFFL */
0, /* OPTIMIZED */
0, /* PSEUDO */
};
@@ -366,6 +375,9 @@ static const char reg_off_by_arg[] = {
0, /* AHOCORASICKC */
0, /* RECURSE */
0, /* SRECURSE */
+ 0, /* NREF */
+ 0, /* NREFF */
+ 0, /* NREFFL */
0, /* OPTIMIZED */
0, /* PSEUDO */
};
@@ -441,39 +453,42 @@ const char * reg_name[] = {
"AHOCORASICKC", /* 0x40 */
"RECURSE", /* 0x41 */
"SRECURSE", /* 0x42 */
- "OPTIMIZED", /* 0x43 */
- "PSEUDO", /* 0x44 */
+ "NREF", /* 0x43 */
+ "NREFF", /* 0x44 */
+ "NREFFL", /* 0x45 */
+ "OPTIMIZED", /* 0x46 */
+ "PSEUDO", /* 0x47 */
/* ------------ States ------------- */
- "TRIE_next", /* 0x45 */
- "TRIE_next_fail", /* 0x46 */
- "EVAL_AB", /* 0x47 */
- "EVAL_AB_fail", /* 0x48 */
- "CURLYX_end", /* 0x49 */
- "CURLYX_end_fail", /* 0x4a */
- "WHILEM_A_pre", /* 0x4b */
- "WHILEM_A_pre_fail", /* 0x4c */
- "WHILEM_A_min", /* 0x4d */
- "WHILEM_A_min_fail", /* 0x4e */
- "WHILEM_A_max", /* 0x4f */
- "WHILEM_A_max_fail", /* 0x50 */
- "WHILEM_B_min", /* 0x51 */
- "WHILEM_B_min_fail", /* 0x52 */
- "WHILEM_B_max", /* 0x53 */
- "WHILEM_B_max_fail", /* 0x54 */
- "BRANCH_next", /* 0x55 */
- "BRANCH_next_fail", /* 0x56 */
- "CURLYM_A", /* 0x57 */
- "CURLYM_A_fail", /* 0x58 */
- "CURLYM_B", /* 0x59 */
- "CURLYM_B_fail", /* 0x5a */
- "IFMATCH_A", /* 0x5b */
- "IFMATCH_A_fail", /* 0x5c */
- "CURLY_B_min_known", /* 0x5d */
- "CURLY_B_min_known_fail", /* 0x5e */
- "CURLY_B_min", /* 0x5f */
- "CURLY_B_min_fail", /* 0x60 */
- "CURLY_B_max", /* 0x61 */
- "CURLY_B_max_fail", /* 0x62 */
+ "TRIE_next", /* 0x48 */
+ "TRIE_next_fail", /* 0x49 */
+ "EVAL_AB", /* 0x4a */
+ "EVAL_AB_fail", /* 0x4b */
+ "CURLYX_end", /* 0x4c */
+ "CURLYX_end_fail", /* 0x4d */
+ "WHILEM_A_pre", /* 0x4e */
+ "WHILEM_A_pre_fail", /* 0x4f */
+ "WHILEM_A_min", /* 0x50 */
+ "WHILEM_A_min_fail", /* 0x51 */
+ "WHILEM_A_max", /* 0x52 */
+ "WHILEM_A_max_fail", /* 0x53 */
+ "WHILEM_B_min", /* 0x54 */
+ "WHILEM_B_min_fail", /* 0x55 */
+ "WHILEM_B_max", /* 0x56 */
+ "WHILEM_B_max_fail", /* 0x57 */
+ "BRANCH_next", /* 0x58 */
+ "BRANCH_next_fail", /* 0x59 */
+ "CURLYM_A", /* 0x5a */
+ "CURLYM_A_fail", /* 0x5b */
+ "CURLYM_B", /* 0x5c */
+ "CURLYM_B_fail", /* 0x5d */
+ "IFMATCH_A", /* 0x5e */
+ "IFMATCH_A_fail", /* 0x5f */
+ "CURLY_B_min_known", /* 0x60 */
+ "CURLY_B_min_known_fail", /* 0x61 */
+ "CURLY_B_min", /* 0x62 */
+ "CURLY_B_min_fail", /* 0x63 */
+ "CURLY_B_max", /* 0x64 */
+ "CURLY_B_max_fail", /* 0x65 */
};
#endif /* DEBUGGING */
#else