-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe-NFA.h
More file actions
64 lines (50 loc) · 1.48 KB
/
e-NFA.h
File metadata and controls
64 lines (50 loc) · 1.48 KB
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
57
58
59
60
61
62
63
64
#ifndef E_NFA_H
#define E_NFA_H
#include "NFA.h"
#include "QStack"
#include "nodenfa.h"
#include <QString>
#include <QSet>
#include <stack>
class e_NFA {
public:
e_NFA();
~e_NFA();
e_NFA(QString str);
e_NFA(QList<QString>);
e_NFA* Regex(QString);
//Build e_NFA
void LoadE_NFA(QList<QString>KeyWords);
// Get
NodeNFA* getStartState();
NodeNFA* getFinit_WordsState();
void addState(NodeNFA*);
void addFinitState(NodeNFA* );
QSet<NodeNFA*> getFinitStates();
QSet<NodeNFA*> getAllStates();
QSet<NodeNFA*> getNonFinitStates();
static QList<char> getAlphabetic();
QList<char> getSeparate_wordsAlphabetic();
void addToFinitState(NodeNFA* state);
void addToState(NodeNFA* state);
void addToState(QSet<NodeNFA*> states);
//Set
void setStartState(NodeNFA *state);
void setFinit_WordsState(NodeNFA *state);
void setAlphabetic(QList<char> alphabetic);
void setSeparate_wordsAlphabetic(QList<char> alphabetic);
// Parses a string and returns a list of tokens
QList<QString> getTokens(QString str);
//Convert from e_NFA to NFA
NFA* convertToNFA();
//closure
QSet<NodeNFA *> getClosure(NodeNFA*);
private:
NodeNFA *StartState ;
NodeNFA *Finit_wordsState;
static QList<char> Alphabetic ;
QList<char> Separate_wordsAlphabetic ;
QSet<NodeNFA*> FinitStates;
QSet<NodeNFA*> AllStates;
};
#endif // E_NFA_H