summaryrefslogtreecommitdiffstats
path: root/maildrop/regexpnode.h
diff options
context:
space:
mode:
authorSam Varshavchik2013-08-19 16:39:41 -0400
committerSam Varshavchik2013-08-25 14:43:51 -0400
commit9c45d9ad13fdf439d44d7443ae75da15ea0223ed (patch)
tree7a81a04cb51efb078ee350859a64be2ebc6b8813 /maildrop/regexpnode.h
parenta9520698b770168d1f33d6301463bb70a19655ec (diff)
downloadcourier-libs-9c45d9ad13fdf439d44d7443ae75da15ea0223ed.tar.bz2
Initial checkin
Imported from subversion report, converted to git. Updated all paths in scripts and makefiles, reflecting the new directory hierarchy.
Diffstat (limited to 'maildrop/regexpnode.h')
-rw-r--r--maildrop/regexpnode.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/maildrop/regexpnode.h b/maildrop/regexpnode.h
new file mode 100644
index 0000000..381e531
--- /dev/null
+++ b/maildrop/regexpnode.h
@@ -0,0 +1,35 @@
+#ifndef regexpnode_h
+#define regexpnode_h
+
+
+#include "config.h"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// class RegExpNode represents a node in a non-deterministic automaton that
+// represents a regular expression.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+class RegExpNode {
+public:
+ RegExpNode *next; // List of all the nodes in the automaton
+ unsigned id; // Unique ID of this node.
+ int thechar; // Character for this node, or one of the
+ // following special constants:
+
+#define RENULL -1 // Null transition
+#define RESET -2 // This is a set
+#define REFINAL -3 // Final node - acceptance
+
+
+ RegExpNode *next1, *next2; // Up to two transitions for this node
+ // (next2 is used only by RENULLs
+ unsigned char *reset; // Used by RESETs
+
+ RegExpNode(unsigned i) : next(0), id(i), thechar(0),
+ next1(0), next2(0), reset(0) {}
+ ~RegExpNode() { if (reset) delete[] reset; }
+} ;
+
+#endif