#include #include #include #include extern "C" { #include #include } #define TextSize 512 //a practical limit for input text size #define VERSIONDATE "April 2, 2000" #define MAXCODESIZE 65536 #define MAXLISTNODES 512 class listnode { public: listnode(char v); void setkeycode(int code); /* saves code of keyword */ char val; //character value int keyword; //keyword code(nextchar should be 0) int state; //state number int passes; //how many keywords passed this state listnode *nextchar; //next char in a string listnode *altchar; //alternative char int reserved; //reserved state protected: }; class listtree { public: listtree(bool insens, bool whole); ~listtree(); int totalstates() { return nextstate - 1; } char *addkeyword(char *t); /* add a keyword to the tree */ int jumptable(char *code); int statetable(char *code); listnode *searchstate(int state); listnode *searchnextstate(listnode *to); listnode *searchnextstate2(int tostate); int keywords; int Error; protected: bool insensitive; bool wholeword; int searchindex; int searchnextindex; listnode *Start; //root node listnode *List[MAXLISTNODES]; //linear list of all nodes int ListIndex; int nextstate; }; void ReportError(char Err); int generate(char *Text, bool Insense, bool Whole); void TimeStamp(); void Banner();