?? main.c
字號(hào):
//main.c
#include "RND.h"
void main()
{
/* ________________初始化操作________________*/
fpout=fopen(FileOutputPath,"w");
if (!Readalphabet())
{
printf(" Error in opening files: alphabet.txt . Please check it. \n");
exit(1);
}
if (!Readregexp())
{
printf(" Error in opening files: regexp.txt . Please check it.\n");
exit(1);
}
if (!LexScan(Regexp))//判斷正則表達(dá)式是否符合要求
{
printf(" The regular express is illegal, please check it! \n");
exit(1);
}
else
printf(" Lexical scan passed, The regular express is legel.\n");
fprintf(fpout," Lexical scan passed, The regular express is legel.\n");
AddConcatenation();//正則式加入連接符“+”
REtoPostfix();//轉(zhuǎn)化為后綴表達(dá)式
/* ________________RegExp==>NFA________________*/
/*構(gòu)造NFA__采用Thompson's Algorithm*/
Nfa=(NFA *)malloc(sizeof(NFA));
Init_Nfa();
ConstructNFA();//Thompson's Algorithm核心算法
OutputNFA();//輸出NFA圖
/* ________________NFA==>DFA________________*/
ConstructDFA();//將NFA生成對(duì)應(yīng)的DFA__子集構(gòu)造法
OutputDFA();//輸出DFA
printf(" _______________________________End_________________________________ \n ");
fprintf(fpout," _______________________________End_________________________________\n ");
fclose(fpout);
printf(" You can see all above in the Report.txt at the same path Please press Enter to exit!\n");
getchar();
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -