summaryrefslogtreecommitdiff
path: root/regnodes.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2006-10-31 23:49:57 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-11-01 17:05:03 +0000
commit5461259206276a3618e115d5d68776273bb41ca6 (patch)
tree62be0b5e283fa9c04597fe6ec054cc83064e0f87 /regnodes.h
parenta983b08dc7c658d412bac21b8ceac00c24ae5c11 (diff)
downloadperl-5461259206276a3618e115d5d68776273bb41ca6.tar.gz
Add a commit verb to regex engine to allow fine tuning of backtracking control.
Message-ID: <9b18b3110610311349n5947cc8fsf0b2e6ddd9a7ee01@mail.gmail.com> p4raw-id: //depot/perl@29183
Diffstat (limited to 'regnodes.h')
-rw-r--r--regnodes.h143
1 files changed, 77 insertions, 66 deletions
diff --git a/regnodes.h b/regnodes.h
index 766dcff1ad..c42fcf89af 100644
--- a/regnodes.h
+++ b/regnodes.h
@@ -6,8 +6,8 @@
/* Regops and State definitions */
-#define REGNODE_MAX 75
-#define REGMATCH_STATE_MAX 105
+#define REGNODE_MAX 76
+#define REGMATCH_STATE_MAX 108
#define END 0 /* 0000 End of program. */
#define SUCCEED 1 /* 0x01 Return from a subroutine, basically. */
@@ -83,41 +83,44 @@
#define INSUBP 71 /* 0x47 Whether we are in a specific recurse. */
#define DEFINEP 72 /* 0x48 Never execute directly. */
#define OPFAIL 73 /* 0x49 Same as (?!) */
-#define OPTIMIZED 74 /* 0x4a Placeholder for dump. */
-#define PSEUDO 75 /* 0x4b Pseudo opcode for internal use. */
+#define COMMIT 74 /* 0x4a Pattern fails if backtracking through this */
+#define OPTIMIZED 75 /* 0x4b Placeholder for dump. */
+#define PSEUDO 76 /* 0x4c Pseudo opcode for internal use. */
/* ------------ States ------------- */
-#define TRIE_next 76 /* 0x4c Regmatch state for TRIE */
-#define TRIE_next_fail 77 /* 0x4d Regmatch state for TRIE */
-#define EVAL_AB 78 /* 0x4e Regmatch state for EVAL */
-#define EVAL_AB_fail 79 /* 0x4f Regmatch state for EVAL */
-#define CURLYX_end 80 /* 0x50 Regmatch state for CURLYX */
-#define CURLYX_end_fail 81 /* 0x51 Regmatch state for CURLYX */
-#define WHILEM_A_pre 82 /* 0x52 Regmatch state for WHILEM */
-#define WHILEM_A_pre_fail 83 /* 0x53 Regmatch state for WHILEM */
-#define WHILEM_A_min 84 /* 0x54 Regmatch state for WHILEM */
-#define WHILEM_A_min_fail 85 /* 0x55 Regmatch state for WHILEM */
-#define WHILEM_A_max 86 /* 0x56 Regmatch state for WHILEM */
-#define WHILEM_A_max_fail 87 /* 0x57 Regmatch state for WHILEM */
-#define WHILEM_B_min 88 /* 0x58 Regmatch state for WHILEM */
-#define WHILEM_B_min_fail 89 /* 0x59 Regmatch state for WHILEM */
-#define WHILEM_B_max 90 /* 0x5a Regmatch state for WHILEM */
-#define WHILEM_B_max_fail 91 /* 0x5b Regmatch state for WHILEM */
-#define BRANCH_next 92 /* 0x5c Regmatch state for BRANCH */
-#define BRANCH_next_fail 93 /* 0x5d Regmatch state for BRANCH */
-#define CURLYM_A 94 /* 0x5e Regmatch state for CURLYM */
-#define CURLYM_A_fail 95 /* 0x5f Regmatch state for CURLYM */
-#define CURLYM_B 96 /* 0x60 Regmatch state for CURLYM */
-#define CURLYM_B_fail 97 /* 0x61 Regmatch state for CURLYM */
-#define IFMATCH_A 98 /* 0x62 Regmatch state for IFMATCH */
-#define IFMATCH_A_fail 99 /* 0x63 Regmatch state for IFMATCH */
-#define CURLY_B_min_known 100 /* 0x64 Regmatch state for CURLY */
-#define CURLY_B_min_known_fail 101 /* 0x65 Regmatch state for CURLY */
-#define CURLY_B_min 102 /* 0x66 Regmatch state for CURLY */
-#define CURLY_B_min_fail 103 /* 0x67 Regmatch state for CURLY */
-#define CURLY_B_max 104 /* 0x68 Regmatch state for CURLY */
-#define CURLY_B_max_fail 105 /* 0x69 Regmatch state for CURLY */
+#define TRIE_next 77 /* 0x4d Regmatch state for TRIE */
+#define TRIE_next_fail 78 /* 0x4e Regmatch state for TRIE */
+#define EVAL_AB 79 /* 0x4f Regmatch state for EVAL */
+#define EVAL_AB_fail 80 /* 0x50 Regmatch state for EVAL */
+#define CURLYX_end 81 /* 0x51 Regmatch state for CURLYX */
+#define CURLYX_end_fail 82 /* 0x52 Regmatch state for CURLYX */
+#define WHILEM_A_pre 83 /* 0x53 Regmatch state for WHILEM */
+#define WHILEM_A_pre_fail 84 /* 0x54 Regmatch state for WHILEM */
+#define WHILEM_A_min 85 /* 0x55 Regmatch state for WHILEM */
+#define WHILEM_A_min_fail 86 /* 0x56 Regmatch state for WHILEM */
+#define WHILEM_A_max 87 /* 0x57 Regmatch state for WHILEM */
+#define WHILEM_A_max_fail 88 /* 0x58 Regmatch state for WHILEM */
+#define WHILEM_B_min 89 /* 0x59 Regmatch state for WHILEM */
+#define WHILEM_B_min_fail 90 /* 0x5a Regmatch state for WHILEM */
+#define WHILEM_B_max 91 /* 0x5b Regmatch state for WHILEM */
+#define WHILEM_B_max_fail 92 /* 0x5c Regmatch state for WHILEM */
+#define BRANCH_next 93 /* 0x5d Regmatch state for BRANCH */
+#define BRANCH_next_fail 94 /* 0x5e Regmatch state for BRANCH */
+#define CURLYM_A 95 /* 0x5f Regmatch state for CURLYM */
+#define CURLYM_A_fail 96 /* 0x60 Regmatch state for CURLYM */
+#define CURLYM_B 97 /* 0x61 Regmatch state for CURLYM */
+#define CURLYM_B_fail 98 /* 0x62 Regmatch state for CURLYM */
+#define IFMATCH_A 99 /* 0x63 Regmatch state for IFMATCH */
+#define IFMATCH_A_fail 100 /* 0x64 Regmatch state for IFMATCH */
+#define CURLY_B_min_known 101 /* 0x65 Regmatch state for CURLY */
+#define CURLY_B_min_known_fail 102 /* 0x66 Regmatch state for CURLY */
+#define CURLY_B_min 103 /* 0x67 Regmatch state for CURLY */
+#define CURLY_B_min_fail 104 /* 0x68 Regmatch state for CURLY */
+#define CURLY_B_max 105 /* 0x69 Regmatch state for CURLY */
+#define CURLY_B_max_fail 106 /* 0x6a Regmatch state for CURLY */
+#define COMMIT_next 107 /* 0x6b Regmatch state for COMMIT */
+#define COMMIT_next_fail 108 /* 0x6c Regmatch state for COMMIT */
/* PL_regkind[] What type of regop or state is this. */
@@ -199,6 +202,7 @@ EXTCONST U8 PL_regkind[] = {
INSUBP, /* INSUBP */
DEFINEP, /* DEFINEP */
OPFAIL, /* OPFAIL */
+ COMMIT, /* COMMIT */
NOTHING, /* OPTIMIZED */
PSEUDO, /* PSEUDO */
/* ------------ States ------------- */
@@ -232,6 +236,8 @@ EXTCONST U8 PL_regkind[] = {
CURLY, /* CURLY_B_min_fail */
CURLY, /* CURLY_B_max */
CURLY, /* CURLY_B_max_fail */
+ COMMIT, /* COMMIT_next */
+ COMMIT, /* COMMIT_next_fail */
};
#endif
@@ -313,6 +319,7 @@ static const U8 regarglen[] = {
EXTRA_SIZE(struct regnode_1), /* INSUBP */
EXTRA_SIZE(struct regnode_1), /* DEFINEP */
0, /* OPFAIL */
+ 0, /* COMMIT */
0, /* OPTIMIZED */
0, /* PSEUDO */
};
@@ -394,6 +401,7 @@ static const char reg_off_by_arg[] = {
0, /* INSUBP */
0, /* DEFINEP */
0, /* OPFAIL */
+ 0, /* COMMIT */
0, /* OPTIMIZED */
0, /* PSEUDO */
};
@@ -476,39 +484,42 @@ const char * reg_name[] = {
"INSUBP", /* 0x47 */
"DEFINEP", /* 0x48 */
"OPFAIL", /* 0x49 */
- "OPTIMIZED", /* 0x4a */
- "PSEUDO", /* 0x4b */
+ "COMMIT", /* 0x4a */
+ "OPTIMIZED", /* 0x4b */
+ "PSEUDO", /* 0x4c */
/* ------------ States ------------- */
- "TRIE_next", /* 0x4c */
- "TRIE_next_fail", /* 0x4d */
- "EVAL_AB", /* 0x4e */
- "EVAL_AB_fail", /* 0x4f */
- "CURLYX_end", /* 0x50 */
- "CURLYX_end_fail", /* 0x51 */
- "WHILEM_A_pre", /* 0x52 */
- "WHILEM_A_pre_fail", /* 0x53 */
- "WHILEM_A_min", /* 0x54 */
- "WHILEM_A_min_fail", /* 0x55 */
- "WHILEM_A_max", /* 0x56 */
- "WHILEM_A_max_fail", /* 0x57 */
- "WHILEM_B_min", /* 0x58 */
- "WHILEM_B_min_fail", /* 0x59 */
- "WHILEM_B_max", /* 0x5a */
- "WHILEM_B_max_fail", /* 0x5b */
- "BRANCH_next", /* 0x5c */
- "BRANCH_next_fail", /* 0x5d */
- "CURLYM_A", /* 0x5e */
- "CURLYM_A_fail", /* 0x5f */
- "CURLYM_B", /* 0x60 */
- "CURLYM_B_fail", /* 0x61 */
- "IFMATCH_A", /* 0x62 */
- "IFMATCH_A_fail", /* 0x63 */
- "CURLY_B_min_known", /* 0x64 */
- "CURLY_B_min_known_fail", /* 0x65 */
- "CURLY_B_min", /* 0x66 */
- "CURLY_B_min_fail", /* 0x67 */
- "CURLY_B_max", /* 0x68 */
- "CURLY_B_max_fail", /* 0x69 */
+ "TRIE_next", /* 0x4d */
+ "TRIE_next_fail", /* 0x4e */
+ "EVAL_AB", /* 0x4f */
+ "EVAL_AB_fail", /* 0x50 */
+ "CURLYX_end", /* 0x51 */
+ "CURLYX_end_fail", /* 0x52 */
+ "WHILEM_A_pre", /* 0x53 */
+ "WHILEM_A_pre_fail", /* 0x54 */
+ "WHILEM_A_min", /* 0x55 */
+ "WHILEM_A_min_fail", /* 0x56 */
+ "WHILEM_A_max", /* 0x57 */
+ "WHILEM_A_max_fail", /* 0x58 */
+ "WHILEM_B_min", /* 0x59 */
+ "WHILEM_B_min_fail", /* 0x5a */
+ "WHILEM_B_max", /* 0x5b */
+ "WHILEM_B_max_fail", /* 0x5c */
+ "BRANCH_next", /* 0x5d */
+ "BRANCH_next_fail", /* 0x5e */
+ "CURLYM_A", /* 0x5f */
+ "CURLYM_A_fail", /* 0x60 */
+ "CURLYM_B", /* 0x61 */
+ "CURLYM_B_fail", /* 0x62 */
+ "IFMATCH_A", /* 0x63 */
+ "IFMATCH_A_fail", /* 0x64 */
+ "CURLY_B_min_known", /* 0x65 */
+ "CURLY_B_min_known_fail", /* 0x66 */
+ "CURLY_B_min", /* 0x67 */
+ "CURLY_B_min_fail", /* 0x68 */
+ "CURLY_B_max", /* 0x69 */
+ "CURLY_B_max_fail", /* 0x6a */
+ "COMMIT_next", /* 0x6b */
+ "COMMIT_next_fail", /* 0x6c */
};
#endif /* DEBUGGING */
#else