plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

dfa.h (456B)


      1 /*
      2  * Deterministic regexp program.
      3  */
      4 typedef struct Dreprog Dreprog;
      5 typedef struct Dreinst Dreinst;
      6 typedef struct Drecase Drecase;
      7 
      8 struct Dreinst
      9 {
     10 	int isfinal;
     11 	int isloop;
     12 	Drecase *c;
     13 	int nc;
     14 };
     15 
     16 struct Dreprog
     17 {
     18 	Dreinst *start[4];
     19 	int ninst;
     20 	Dreinst inst[1];
     21 };
     22 
     23 struct Drecase
     24 {
     25 	uint start;
     26 	Dreinst *next;
     27 };
     28 
     29 Dreprog* dregcvt(Reprog*);
     30 int dregexec(Dreprog*, char*, int);
     31 Dreprog* Breaddfa(Biobuf *b);
     32 void Bprintdfa(Biobuf*, Dreprog*);