-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetTable.cpp
35 lines (29 loc) · 1.03 KB
/
getTable.cpp
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
#include <iostream>
#include<string>
#include <vector>
#include<fstream>
#include "structs.h"
//using std::string;
//using std::iostream;
//using std::vector;
//using std::fstream;
using namespace std;
void getREs(vector<RE>& reFinal);
void re2NFA(vector<RE>& rules,NFA& finalNFA,set<char>& edgeName);
void NFA2DFA(NFA& finalNFA,set<char>& edgeName,vector<DFA*>& resDFA);
void getDFAmin(vector<DFA*>& finalDFA,set<char>& edge,vector<set<DFA*>>& finalDFAmin);
void getTransTable(vector<set<DFA*>>& minDFA,vector<unordered_multimap<char,int>>& transTable,
vector<string>& tokenList);
void getTable(vector<unordered_multimap<char,int>>& transTable,vector<string>& tokenList) {
std::cout << "Hello, World!" << std::endl;
set<char> edge;
vector<RE> rule;
getREs(rule);
NFA finalNFA;
re2NFA(rule,finalNFA,edge);
vector<DFA*> finalDFA ;
NFA2DFA(finalNFA,edge,finalDFA);
vector<set<DFA*>> finalDFAmin;
getDFAmin(finalDFA,edge,finalDFAmin);
getTransTable(finalDFAmin,transTable,tokenList);
}