[style]
This commit is contained in:
parent
936e9ea07d
commit
e9bc9a4107
|
|
@ -64,7 +64,6 @@ enum class WordType {
|
|||
|
||||
UNKOWN
|
||||
};
|
||||
extern std::unordered_map<WordType, std::string> WordTypeNames;
|
||||
|
||||
// 定义输入的字符类别
|
||||
enum class InputCharType {
|
||||
|
|
@ -95,8 +94,6 @@ enum class InputCharType {
|
|||
EPSILON, // 空字符 21
|
||||
};
|
||||
|
||||
extern std::unordered_map<InputCharType, std::string> CharTypeNames;
|
||||
|
||||
// 定义 token类型
|
||||
enum class TokenType {
|
||||
KW = 0,
|
||||
|
|
@ -114,12 +111,13 @@ class Token {
|
|||
TokenType type;
|
||||
};
|
||||
|
||||
// 定义与名称映射
|
||||
extern std::unordered_map<InputCharType, std::string> CharTypeNames;
|
||||
extern std::unordered_map<WordType, std::string> WordTypeNames;
|
||||
|
||||
string getWordTypeName(WordType type);
|
||||
string getInputChartypeName(InputCharType type);
|
||||
|
||||
|
||||
|
||||
|
||||
// 定义函数判断输入的字符类别
|
||||
InputCharType getInputCharType(char c);
|
||||
string getWordTypeName(WordType type,string buffer);
|
||||
|
|
@ -192,6 +190,8 @@ void removeUnreachableStates(DFA& dfa);
|
|||
void printDFA(const DFA& dfa);
|
||||
DFA nfaToDFA(const NFA& nfa);
|
||||
void printDFA(const DFA& dfa);
|
||||
|
||||
|
||||
struct SetComparator {
|
||||
bool operator()(const set<State*, StatePtrCompare>& a, const set<State*, StatePtrCompare>& b) const {
|
||||
if (a.size() != b.size()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue