blob: 37d59a8ada751ddbc002ac99f82aeef8c6d89594 (
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
|
#ifndef reeval_h
#define reeval_h
#include "regexpnode.h"
///////////////////////////////////////////////////////////////////////////
//
// For matching a regular expression, we keep track of the set of all the
// current nodes we're currently on. For speed, there are two ReEval
// objects - current one, and the next one, and we switch between the two
// on each step.
//
///////////////////////////////////////////////////////////////////////////
class ReEval {
public:
RegExpNode **nodes;
unsigned numnodes;
unsigned *nodenums; // For speed - lookup array of nodes
// that are already in this set.
ReEval() : nodes(0), numnodes(0), nodenums(0), arysize(0) {}
~ReEval() { if (nodes) delete[] nodes;
if (nodenums) delete[] nodenums;
}
void init(unsigned maxsize);
private:
unsigned arysize;
} ;
#endif
|