aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/upas/bayes/dfa.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/upas/bayes/dfa.h')
-rw-r--r--src/cmd/upas/bayes/dfa.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/cmd/upas/bayes/dfa.h b/src/cmd/upas/bayes/dfa.h
new file mode 100644
index 00000000..28c43dbc
--- /dev/null
+++ b/src/cmd/upas/bayes/dfa.h
@@ -0,0 +1,33 @@
+/*
+ * Deterministic regexp program.
+ */
+typedef struct Dreprog Dreprog;
+typedef struct Dreinst Dreinst;
+typedef struct Drecase Drecase;
+
+struct Dreinst
+{
+ int isfinal;
+ int isloop;
+ Drecase *c;
+ int nc;
+};
+
+struct Dreprog
+{
+ Dreinst *start[4];
+ int ninst;
+ Dreinst inst[1];
+};
+
+struct Drecase
+{
+ uint start;
+ Dreinst *next;
+};
+
+Dreprog* dregcvt(Reprog*);
+int dregexec(Dreprog*, char*, int);
+Dreprog* Breaddfa(Biobuf *b);
+void Bprintdfa(Biobuf*, Dreprog*);
+