?? getvnvt.cpp
字號:
#include "global.h"
// import
list<string> VN;
list<string> VT;
void getVN()
{
for(int i = 0;i < lineno;i++)
VN.push_back(*(production[i].begin()));
if(!VN.empty()){
removeDup(VN); // remove duplicated elements
cout << "***********************************" << endl;
cout << "** The set of non-ternminal symbols of this grammer is as follow ** \n";
cout << "***********************************" << endl;
cout << endl;
print(VN);
cout << endl;
cout << "***********************************" << endl;
}
}
void getVT()
{
string tmp;
list<string>::iterator point,hold;
for(int i = 0;i < lineno;i++){
point = production[i].begin();
while(*point != "->")
point++;
hold = ++point;
while(hold != production[i].end()){
tmp = *hold;
if(tmp != "|" && !isIn(tmp,VN) && tmp != "e")
VT.push_back(*hold); // push to the set of VT
hold++;
}
}
if(!VT.empty()){
removeDup(VT);
cout << "***********************************" << endl;
cout << "** The set of terminal symbols of this grammer is as follow ** \n";
cout << "***********************************" << endl;
cout << endl;
print(VT);
cout << endl;
cout << "***********************************" << endl;
cout << endl;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -