Back to index

courier  0.68.2
regexpnode.h
Go to the documentation of this file.
00001 #ifndef       regexpnode_h
00002 #define regexpnode_h
00003 
00004 
00005 #include      "config.h"
00006 
00008 //
00009 // class RegExpNode represents a node in a non-deterministic automaton that
00010 // represents a regular expression.
00011 //
00013 
00014 class RegExpNode {
00015 public:
00016        RegExpNode *next;    // List of all the nodes in the automaton
00017        unsigned id;         // Unique ID of this node.
00018        int    thechar;      // Character for this node, or one of the
00019                             // following special constants:
00020 
00021 #define       RENULL -1            // Null transition
00022 #define       RESET  -2            // This is a set
00023 #define       REFINAL       -3            // Final node - acceptance
00024 
00025 
00026        RegExpNode *next1, *next2; // Up to two transitions for this node
00027                             // (next2 is used only by RENULLs
00028        unsigned char *reset;       // Used by RESETs
00029 
00030        RegExpNode(unsigned i) : next(0), id(i), thechar(0),
00031                      next1(0), next2(0), reset(0) {}
00032        ~RegExpNode() { if (reset) delete[] reset; }
00033 } ;
00034 
00035 #endif