-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdfa.h
37 lines (37 loc) · 770 Bytes
/
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
#ifndef DFA_H_
#define DFA_H_
#include<string>
#include "adjacentTable.h"
class DFA {
public:
DFA();
~DFA();
void inputRegex();
void insertNode();
void regexToPost();
void match();
void inputString();
void getEdgeNumber();
void thompson();
void NFAToDFA();
void getAcceptState();
int precedence(char symbol);
int judgeVertex(char ch);
private:
char* regex_;
char* regexPost_;
char* edgeNum_;
int edgeNumber_;
std::string input_;
std::string matchout_;
int NFAStatesNumber_;
int DFAStatesNumber_;
int NFAAcceptStates[500];
int DFAAcceptStates[500];
int NFANodeAll[100][100];
AdjacentTable* DFATable;
AdjacentTable* NFATable;
char DFAStates[101][101];
int miniDFAStates[101][101];
};
#endif