summaryrefslogtreecommitdiffstats
path: root/generic/regcomp.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-03-05 14:04:17 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-03-05 14:04:17 (GMT)
commitfe7e82dfed8be6f8a8c99cfd68d8e1119faee568 (patch)
tree4245df95b6512abc0fbd9bf25b52e1665d3106e3 /generic/regcomp.c
parent59d16caf6d45593fb20aa65a84549ba1debc2e63 (diff)
downloadtcl-fe7e82dfed8be6f8a8c99cfd68d8e1119faee568.zip
tcl-fe7e82dfed8be6f8a8c99cfd68d8e1119faee568.tar.gz
tcl-fe7e82dfed8be6f8a8c99cfd68d8e1119faee568.tar.bz2
Contributed regexp engine patch from Tom Lane. Backports clean from trunk.
Diffstat (limited to 'generic/regcomp.c')
-rw-r--r--generic/regcomp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/generic/regcomp.c b/generic/regcomp.c
index ca4fc01..7116d82 100644
--- a/generic/regcomp.c
+++ b/generic/regcomp.c
@@ -121,12 +121,16 @@ static void destroystate(struct nfa *, struct state *);
static void newarc(struct nfa *, int, pcolor, struct state *, struct state *);
static struct arc *allocarc(struct nfa *, struct state *);
static void freearc(struct nfa *, struct arc *);
+static int nonemptyouts(struct state *);
+static int nonemptyins(struct state *);
static struct arc *findarc(struct state *, int, pcolor);
static void cparc(struct nfa *, struct arc *, struct state *, struct state *);
static void moveins(struct nfa *, struct state *, struct state *);
static void copyins(struct nfa *, struct state *, struct state *);
+static void copynonemptyins(struct nfa *, struct state *, struct state *);
static void moveouts(struct nfa *, struct state *, struct state *);
static void copyouts(struct nfa *, struct state *, struct state *);
+static void copynonemptyouts(struct nfa *, struct state *, struct state *);
static void cloneouts(struct nfa *, struct state *, struct state *, struct state *, int);
static void delsub(struct nfa *, struct state *, struct state *);
static void deltraverse(struct nfa *, struct state *, struct state *);
@@ -144,7 +148,8 @@ static int push(struct nfa *, struct arc *);
#define COMPATIBLE 3 /* compatible but not satisfied yet */
static int combine(struct arc *, struct arc *);
static void fixempties(struct nfa *, FILE *);
-static int unempty(struct nfa *, struct arc *);
+static struct state *emptyreachable(struct state *, struct state *);
+static void replaceempty(struct nfa *, struct state *, struct state *);
static void cleanup(struct nfa *);
static void markreachable(struct nfa *, struct state *, struct state *, struct state *);
static void markcanreach(struct nfa *, struct state *, struct state *, struct state *);