-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDFA.h
56 lines (36 loc) · 1.16 KB
/
DFA.h
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// Created by yexuf on 4/8/2019.
//
#ifndef DAY0408_COMPLINGPRICIPLE_DFA_DFA_H
#define DAY0408_COMPLINGPRICIPLE_DFA_DFA_H
#include <map>
#include <vector>
#include "DFANode.h"
class DFA {
private:
//起始节点
DFANode *pDFAStart;
//终止节点
std::vector<std::string>endFlags;
//节点
std::map<std::string, DFANode> nodes;
private:
// int setDFANodes();
public:
int setAutomation();
void DFANodesShow();
public:
DFANode *getPDFAStart() const;
void setPDFAStart(DFANode *pDFAStart);
const std::vector<std::string> &getEndFlags() const;
const std::map<std::string, DFANode> &getNodes() const;
void setNodes(const std::map<std::string, DFANode> &nodes);
void setEndFlags(const std::vector<std::string> &endFlags);
std::map<std::string, DFANode>::iterator getNodesIterBegin();
std::map<std::string, DFANode>::iterator getNodesIterEnd();
std::map<std::string, DFANode>::iterator getNodesIterByFind(std::string condition);
std::map<std::string, DFANode>::iterator getIterator(std::string key);
public:
bool checkSequence(std::string &seq);
};
#endif //DAY0408_COMPLINGPRICIPLE_DFA_DFA_H