亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? buileset.cpp

?? 一個語法分析程序,C++寫的,內含原碼和exe文件. 開發工具:DEV-C
?? CPP
字號:
/*
  To construct FIRST and FOLLOW set
  This part plays a key role up-bottom anlysis. 
  And it is the most difficult part to code.
    start on 6.5
   plan finish on 6.7  
                       by Math Frog 
  */
#include "global.h"
// import global variable 

elem symbol[MAXSIZE];

list<string> coProduction[MAXLINE];

list<string> cofirst; // to hold the tempory first set
                      // for the production list X1X2...Xn
const int CNT = 2;// scan times
const int _CNT = 3;
int colineno = 0; // lineno of the new grammer

void getName()
{
   int i = 0;
   list<string>::iterator iter = VN.begin();
   while(iter != VN.end())
   symbol[i++].name = *iter++; // get name of each symbol
}

/*
** build first set for each non-terminals ** 
   finished on 6.6    Math Frog
*/
void buildFirst()
{
string hold1,hold2,hold3;
list<string> hold; // hold for getting separete production
int save1,save2; // save position  
int cnt = 0;
int mark;
bool flag; 
list<string>::iterator iter,tmp;
getName();
////////////////// first scan ////////////////////////
///////// using rule one and two ////////////////////
for(int i = 0;i < lineno;i++){
   iter = production[i].begin();
  // for tempory search
   hold1 = *iter; // it's the non-terminal
   iter++;
   iter++; // move backward for two step to get iter point to the 
          //  right of the produciton
   tmp = iter; // use tmp now
   hold2 = *tmp; // hold for seaching
while(true){
    if(isIn(hold2,VT) || hold2 == ee){
       for(int k = 0;k < VN.size();k++)
          if(symbol[k].name == hold1 && !isIn(hold2,symbol[k].first))
             symbol[k].first.push_back(hold2); 
        }
      while(tmp != production[i].end()){
          if(*tmp == "|"){
             tmp++;
             hold2 = *tmp;
             break;
           }
           tmp++;
        }
        if(tmp == production[i].end())
         break;
    } 
  
} 
      // second scan for the production A->X1..Xk
   /////////// second scan ///////////////////////////
  ///////// use the third rule ///////////////////////
  
while(cnt < CNT){ // for at most two times can get the first set
for(int line = 0;line < colineno;line++) {
   mark = 0;
    // in fact , this pass can be added to the first scan 
   hold1 = coProduction[line].front(); // save for searching
    iter = coProduction[line].begin();
   iter++;
   iter++; // move backward to the first of the right
   flag = true; // set flag true
while(flag == true && iter != coProduction[line].end()){
       hold2 = *iter;
   if((isIn(hold2,VT) && mark == 0 ) || hold2 == ee) // if the current symbol is a terminal 
       {mark++;  break ; }
       // add it directly
      // just ingore it
   else{ // the current symbol is a non-terminal
       for(int _i = 0;_i < VN.size();_i++) 
         if(hold1 == symbol[_i].name)
           { save1 = _i;   break; }
        for(int _j = 0;_j < VN.size();_j++) 
          if(hold2 == symbol[_j].name)
             {save2 = _j; break;}
     if(isIn(hold2,VT) && !isIn(hold2,symbol[save1].first) & hold2 != ee) 
        symbol[save1].first.push_back(hold2);
      // after found the position ,let us copy it
        else{ 
         tmp = symbol[save2].first.begin();
        while(tmp != symbol[save2].first.end()){
          hold3 = *tmp;
          if(!isIn(hold3,symbol[save1].first) && hold3 != ee)
           symbol[save1].first.push_back(hold3);
           tmp++;
        }  
       }
      }   
        if(!isIn(ee,symbol[save2].first)) 
          flag = false; // set flag to false to end the loop
        iter++; // move backward
        if(flag == true && !isIn(ee,symbol[save1].first)) 
        symbol[save1].first.push_back(ee); // add e to the first
    }  
   }
   cnt++;
  }
}
//////////////////////////////////////////////
/////////// BUild FOLLOW Set finished on 6.8
////                ** Math Frog  ** /////////
/////////////////////////////////////////////
void buildFollow()
{
   list<string>::iterator iter,it,copy;
   int save,save1,save2;
   int cnt = 0;
   symbol[0].follow.push_back("$");
  while(cnt < _CNT){
    for(int line = 0;line < colineno;line++){
        iter = coProduction[line].begin();
        for(int k = 0;k < VN.size();k++)
         if(*iter == symbol[k].name)
           {save = k;break;} 
         iter++;
         iter++;
while(iter != coProduction[line].end()){
     if(isIn(*iter,VN)){
           //// compute Xi+1Xi+2 ..Xn  ////////////////
       for(int i = 0;i < VN.size();i++)
            if(symbol[i].name == *iter)
              {save1 = i;break;}
   if(iter == --(coProduction[line].end()))
        {cofirst.push_back(ee); }
        else{
           it = iter;
            it++;
         while(it != coProduction[line].end()){
             if(isIn(*it,VT))
               {cofirst.push_back(*it);break;}
            else{
             for(int j = 0;j < VN.size();j++)
                   if(symbol[j].name == *it)
                     {save2 = j;break;}     
             for(copy = symbol[save2].first.begin();copy != symbol[save2].first.end();copy++)
                     if(!isIn(*copy,cofirst))
                        cofirst.push_back(*copy); 
             }
           if(!isIn(ee,symbol[save2].first)) break;
              it++;
             }
          }
         for(copy = cofirst.begin();copy != cofirst.end();copy++)
               if(!isIn(*copy,symbol[save1].follow) && *copy != ee)
                 symbol[save1].follow.push_back(*copy); 
        if(isIn(ee,cofirst)){
         for(copy = symbol[save].follow.begin();copy != symbol[save].follow.end();copy++)
           if(!isIn(*copy,symbol[save1].follow) && *copy != ee)
             symbol[save1].follow.push_back(*copy); 
           }   
         }  
        cofirst.erase(cofirst.begin(),cofirst.end()); 
          iter++;
         }
      } // the loop for(;;)
     cnt++;
   } // scan times
}
void printFirst()
{
cout << "***********************************" << endl;
  cout << "** The FIRST sets are as follow **"<< endl;
  cout << "***********************************" << endl;
  for(int i_ = 0;i_ < VN.size();i_++){
  list<string>::iterator iter = symbol[i_].first.begin();
    cout << "FIRST" << "( " << symbol[i_].name << " ) = " << "{ ";
    while(iter != symbol[i_].first.end()){
       cout << *iter;
     if(iter != --symbol[i_].first.end())
       cout << ",";  // the output formation use my precious 3 minutes  :(
       iter++;
       }
       cout << " }" << endl;
   }
    cout << "***********************************" << endl;
    cout << endl;
}

  void printFollow()
{
cout << "***********************************" << endl;
cout << "** The FOLLOW sets are as follow **" << endl;
cout << "***********************************" << endl;
   for(int i = 0;i  < VN.size();i++){
   list<string>::iterator iter = symbol[i].follow.begin();
   cout << "Follow" << "( " << symbol[i].name << " ) = " << "{ ";
   while(iter != symbol[i].follow.end()){
    cout << *iter;
    if(iter != --symbol[i].follow.end())
     cout << ",";
     iter++;
   }
   cout << " }" << endl;
}
  cout << endl;
} 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区电影在线观看| 亚洲永久免费视频| 婷婷亚洲久悠悠色悠在线播放| 日韩电影在线观看网站| 成人福利在线看| 欧美日韩一卡二卡三卡| 亚洲国产精品成人综合色在线婷婷| 亚洲gay无套男同| a亚洲天堂av| 久久久久久久国产精品影院| 午夜婷婷国产麻豆精品| 成人黄色电影在线 | 国产一区二区三区视频在线播放| 色屁屁一区二区| 久久久久久久综合| 久久精品免费观看| 欧美亚洲一区二区在线| 中文字幕一区二区三区乱码在线| 激情伊人五月天久久综合| 日本v片在线高清不卡在线观看| 亚洲国产视频一区二区| 成人在线一区二区三区| 欧美成人a在线| 亚洲免费在线视频一区 二区| 九九久久精品视频| 欧美一二三区在线| 午夜av一区二区三区| 欧美性感一区二区三区| 亚洲精品少妇30p| 波多野结衣亚洲一区| 国产视频一区在线播放| 激情综合色播五月| 精品国产伦一区二区三区免费| 日韩电影在线一区| 日韩欧美电影一二三| 天天综合网天天综合色| 在线成人午夜影院| 久久草av在线| 久久午夜电影网| 国产精品99久久久久| 久久综合色综合88| 成人综合婷婷国产精品久久蜜臀| 欧美日韩一区视频| 午夜精品久久久久久久久| 国产风韵犹存在线视精品| 久久福利视频一区二区| av亚洲精华国产精华精华 | 日韩精品中文字幕一区| 粉嫩aⅴ一区二区三区四区| 激情图片小说一区| 91色.com| 国产一区二区免费在线| 国产69精品久久99不卡| 99久久婷婷国产综合精品| 91精品国产乱码久久蜜臀| 日韩电影免费在线看| 91精品国产综合久久福利| 日韩av中文字幕一区二区三区| 欧美一区二区三区男人的天堂| 国产在线精品一区二区| 亚洲国产成人在线| 欧美艳星brazzers| 久久精品国产亚洲a| 国产精品美女久久久久久| 欧美在线综合视频| 国产精品系列在线播放| 一区二区三区日韩在线观看| 欧美一区永久视频免费观看| 国产成人在线免费观看| 亚洲五码中文字幕| 久久人人爽人人爽| 在线亚洲欧美专区二区| 国产在线一区二区| 一区二区三区美女| 久久看人人爽人人| 欧美午夜理伦三级在线观看| 久久se精品一区精品二区| 亚洲猫色日本管| 久久久亚洲国产美女国产盗摄 | 日韩一区二区三区高清免费看看| 精品无人码麻豆乱码1区2区| 亚洲视频电影在线| 久久日韩粉嫩一区二区三区| 欧美曰成人黄网| 北条麻妃一区二区三区| 久久成人免费网站| 亚洲一区二区三区激情| 国产精品入口麻豆九色| 欧美一区二区视频免费观看| 色综合婷婷久久| 91国内精品野花午夜精品| 亚洲综合成人在线视频| 久久久久久久久99精品| 制服丝袜av成人在线看| 91首页免费视频| 国产精品综合在线视频| 日本欧美一区二区| 亚洲精品亚洲人成人网| 欧美国产乱子伦| 亚洲理论在线观看| 国产精品久久毛片| 久久久精品免费免费| 日韩免费电影一区| 欧美日韩综合在线免费观看| 97se亚洲国产综合自在线观| 国产高清无密码一区二区三区| 免费在线成人网| 日韩高清一区在线| 五月天久久比比资源色| 亚洲国产综合在线| 亚洲一区二区三区免费视频| 中文字幕一区二区三区不卡在线| 久久综合九色综合97婷婷女人 | 国产精品丝袜久久久久久app| 精品视频在线看| 91啦中文在线观看| 99久久精品国产毛片| 99久久精品国产精品久久| 成人精品免费看| 国产精品一线二线三线| 精品在线观看视频| 久久爱另类一区二区小说| 老司机精品视频在线| 久久综合综合久久综合| 国产一区二区成人久久免费影院 | 亚洲国产精品久久不卡毛片| 亚洲免费伊人电影| 一区二区三区成人| 亚洲成人动漫在线观看| 成人av小说网| 成人激情黄色小说| 91久久精品国产91性色tv| 欧日韩精品视频| 91精品国产综合久久精品图片| 日韩小视频在线观看专区| 26uuu久久综合| 国产精品日韩精品欧美在线| 亚洲视频一区二区在线观看| 亚洲一区二区精品3399| 日本免费新一区视频| 国产精品亚洲专一区二区三区| 成人深夜视频在线观看| 一本大道av一区二区在线播放| 欧美日韩电影在线| 精品99久久久久久| 亚洲视频免费在线观看| 亚洲一区二区偷拍精品| 久久精品国产亚洲高清剧情介绍 | 日韩精品色哟哟| 国产精品一区二区在线观看网站| jlzzjlzz亚洲日本少妇| 欧美日韩卡一卡二| 欧美精品一区二区三区高清aⅴ| 中文乱码免费一区二区| 午夜精品视频一区| 国产不卡在线视频| 精品视频一区 二区 三区| 久久伊99综合婷婷久久伊| 成人欧美一区二区三区视频网页| 夜夜嗨av一区二区三区中文字幕| 蜜臀久久99精品久久久久久9| 波多野结衣中文字幕一区| 337p亚洲精品色噜噜噜| 国产精品美女www爽爽爽| 肉肉av福利一精品导航| 九九精品一区二区| 粉嫩aⅴ一区二区三区四区 | 亚洲黄色av一区| 欧美午夜电影在线播放| 精品国产乱码久久久久久蜜臀| 尤物在线观看一区| 国产精品自拍一区| 555www色欧美视频| 亚洲宅男天堂在线观看无病毒| 国产主播一区二区三区| 欧美日韩成人综合天天影院| 日本一区二区高清| 国产一区啦啦啦在线观看| 69久久夜色精品国产69蝌蚪网| 亚洲丝袜制服诱惑| 风间由美一区二区av101| 欧美xxxx老人做受| 日本不卡一区二区三区| 在线亚洲+欧美+日本专区| 国产精品日产欧美久久久久| 久久99蜜桃精品| 在线综合+亚洲+欧美中文字幕| 亚洲免费在线视频| 91麻豆福利精品推荐| 国产精品免费丝袜| 国产精品一区二区你懂的| 精品国内二区三区| 精品一区二区av| 日韩精品中文字幕在线不卡尤物| 丝袜美腿一区二区三区| 欧美人牲a欧美精品| 五月天精品一区二区三区| 欧美日韩一区 二区 三区 久久精品| 亚洲激情自拍偷拍| 91久久精品一区二区二区|