Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
BitchX
GitHub Repository: BitchX/BitchX1.3
Path: blob/master/dll/europa/cse476/parse.h
1074 views
1
#include "gnode.h"
2
3
void parse(char *text);
4
void processAgenda(void);
5
6
typedef struct activeArc {
7
int begLoc;
8
int endLoc;
9
int numFound;
10
List *ruleLine;
11
};
12
13
class ActiveArcList {
14
public:
15
ActiveArcList();
16
void add(activeArc *newArc);
17
List *findMatch(int begLoc, int endLoc, genericNode *obj);
18
bool goTop(void);
19
bool goNext(void);
20
activeArc *currArc(void);
21
void print(void);
22
23
24
private:
25
struct arcNode;
26
typedef struct arcNode {
27
activeArc *arc;
28
arcNode *nextPtr;
29
};
30
31
arcNode *rootPtr;
32
arcNode *currPtr;
33
};
34
35
class Chart {
36
public:
37
Chart();
38
39
void add(int begLoc, int endLoc, genericNode *obj);
40
void getKey(int &begLoc, int &endLoc, genericNode *&obj);
41
42
// returns true if there are more keys on the agenda that need processing
43
bool process(void); // GOOD
44
45
bool findMatch(genericNode *obj, List *&assign, int begLoc, int &endLoc);
46
List *findNext(void);
47
48
void print(void);
49
50
private:
51
struct chartNode;
52
typedef struct chartNode {
53
int begLoc;
54
int endLoc;
55
genericNode *obj;
56
bool processFlag;
57
58
chartNode *nextPtr;
59
};
60
61
chartNode *rootPtr;
62
chartNode *currPtr;
63
genericNode *searchObj;
64
};
65
66