aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/upas/bayes/dfa.h
blob: 429f04e586684cf3eaa36be8a4dbe474e4f0955d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * 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*);