freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

編譯課程設(shè)計(jì)報(bào)告書-wenkub.com

2024-10-03 09:16 本頁面
   

【正文】 3 基于算符優(yōu)先分析方法的語法制導(dǎo)翻譯程序的設(shè)計(jì) 在算符優(yōu)先分析的基礎(chǔ)上進(jìn)行本次實(shí)驗(yàn),思路還是比較清晰的,處理的難點(diǎn)就是將規(guī)約與上面的實(shí)驗(yàn)區(qū)別開來,采用轉(zhuǎn)化為數(shù)字的方式,比較容易的將這一問題合理的解決,在生成產(chǎn)生式時(shí)對(duì)使用哪一個(gè)產(chǎn)生式的判斷是必不可少的。同時(shí)感謝老師的耐心指導(dǎo)與講解! 1. 詞法分析器設(shè)計(jì) 通過詞法分析器的設(shè)計(jì)更加深刻的理解詞法的概念,也明確了運(yùn)算符、界符、標(biāo)識(shí)符、常數(shù)的定義,實(shí)驗(yàn)需要注意的問題是對(duì)空格的過濾,這個(gè)是尤其重要的,此外對(duì)“ **”的判斷也應(yīng)該單獨(dú)處理,總體來講實(shí)驗(yàn)比較成功。通過這次試驗(yàn),我加深對(duì)課堂教學(xué)內(nèi)容的理解,培養(yǎng)解決實(shí)際問題能力。l++) { coutl:。 cout~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~endl。 int t[MAX]。 (a)。 } else { ()。(SearchCost((statopvt),a)==2)) { cout錯(cuò)誤 !endl。 statopvt=()1。 } int start=()。 if((lowpos)200) lowpos。 while(a200amp。 a=Digital[0]。 28 (7)。\t39。\t39。 cout*******************************************************endl。 cout請(qǐng)輸入一段程序 (以 結(jié)束! ):endl。 int fp=0。 int a。digital[d_len1]==2) digital[d_len1]=3。 system(pause)。ilen。 if(IsChar(ch)) { return Entry(ch)。 } int CharToDigital(char ch) { int j。iSign[0]。 return NewTemp(ch)。 cout==。ch[1]100) { cout合并: 。 } else if(ch[0]100amp。 cout)==。amp。 DispItem(Tp+200)。 if(ll==1) { Temp[++Tp]=ch[0]。 } else if(i200) { coutSign[i100]。 } void DispIndirect(int i) { if(i0||i=400) { coutError!endl。 } else if(i200) { coutSign[i100]。 return 。 four[Fp]DispFour()。 default:return 2。 case 39。 case 39。 switch(cost[i][j]) { case 39。))) return true。)amp。(c=39。)) || (c=39。)amp。\t39。!39。i8。\t39。\t39。 } void DispStack() { for(int i=0。 } } int GetChar(int pos) { if((pos=0)amp。 } top=toplength。 else coutover flow!endl。 public: stack(){top=0。 } }*Four。 DispIndirect(s2)。 else coutop。 cout (。 cout,。 cout,。 if(op==39。 thiss1=s1。d_len,int len)。 void DispItem(int i)。 int SearchCost(int i,int j)。 int Tp。 int Dp=0。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。,39。 二、設(shè)計(jì)(實(shí)驗(yàn))正文 1. 程序流程圖如下 17 Y N N Y N Y Y : 開始 輸出優(yōu)先關(guān)系表 輸入字符串 ‘ ’壓棧 當(dāng)前字符為‘ ’ ? ’ 棧中為“ N” 不是句子 出棧 是句子 結(jié)束 棧頂終結(jié)符與當(dāng)前字符比較 大于? 規(guī)約 入棧 判斷產(chǎn)生式類型 為前三個(gè)產(chǎn)生式? 生成產(chǎn)生式 下一個(gè)字符 18 includeiostream includestring using namespace std。 基于算符優(yōu)先分析方法的語法制導(dǎo)翻譯程序 設(shè)計(jì)的 實(shí)驗(yàn)要求 算符優(yōu)先分析方法是通過反復(fù)把輸入符號(hào)移進(jìn)分析棧,使用優(yōu)先關(guān)系表在分析棧頂尋找最左素短語,將其歸約為 一個(gè)非終結(jié)符號(hào)而實(shí)現(xiàn)的。 } : 16 實(shí)驗(yàn)三 . 基于算符優(yōu)先分析方法的語法制導(dǎo)翻譯的設(shè)計(jì)與實(shí)現(xiàn) 一、課程 設(shè)計(jì) (綜合實(shí)驗(yàn) )的目的與要求 基于算符優(yōu)先分析方法的語法制導(dǎo)翻譯程序 設(shè)計(jì)的 實(shí)驗(yàn) 目的 本實(shí)驗(yàn)是為計(jì)算機(jī)科學(xué)與技術(shù)專業(yè)的學(xué)生在學(xué)習(xí) 《 編譯技術(shù) 》 課程 后,為加深對(duì)課堂教學(xué)內(nèi)容的理解,培養(yǎng)解決實(shí)際問題能力而設(shè)置的實(shí)踐環(huán)節(jié)。 (3)。 (a)。 if(a==39。 cout第 strp+1 字符是錯(cuò)的 !endl。Z39。A39。endl。) cout**。 for(int i=0。 (39。 } int start=()。 //calculate the length of the mergeing string if(!IsVT((lowpos))) lowpos。s priority is greater than the top the push it while(IsVT(a)amp。 strp++。(string[strp+1]==39。 // get the letter if((a==39。 while(a!=39。 a=string[0]。 (string,MAX)。 cout*********************************************************endl。 //point to the letter of the string int statop。39。 } } void main() { char string[MAX]。:return 0。:return 1。:return 1。:j=7。:j=6。:j=5。:j=4。:j=3。:j=2。:j=1。:i=7。:i=6。:i=5。:i=4。:i=3。:i=2。:i=1。 if(Num_Char(ch2)) ch2=39。 else return false。amp。z39。a39。939。039。amp。i++) { 12 if(c==cost[0][i]) { flag=true。 } coutendl。) cout**39。i++) { for(int j=0。\t39。\t39。 cout39。itop。(posMAX)) return array[pos]。 return temp。i++) { temp[i]=array[toplength+i]。 else coutover flow!endl。 public: stack(){top=0。=39。39。39。39。39。 39。39。39。 39。39。39。39。39。 39。39。39。39。39。39。39。39。39。39。39。39。39。39。39。39。(39。!39。+39。 const int MAX=100。 算符優(yōu)先分析過程與非終結(jié)符號(hào)無關(guān),當(dāng)由文法產(chǎn)生了優(yōu)先關(guān)系之后文法也就 失去了作用 ,本題目給出文法的目的是為了便于對(duì)語法分析結(jié)果進(jìn)行驗(yàn)證。通過這個(gè) 實(shí)驗(yàn) ,使學(xué)生應(yīng)用 編譯程序設(shè)計(jì)的 原理和 技術(shù) , 設(shè)計(jì)、編寫和調(diào)試算符優(yōu)先分析程 序 , 了解算符優(yōu)先分析程序的組成結(jié)構(gòu),掌握實(shí)現(xiàn)通用算符優(yōu)先分析算法的方法。39。)。 char a[100]。 cout) 12endl。 cout+8endl。 coutelse 4endl。 int n=0。)zbbm,)endl。 } else { zbbm=9。 m+=2。*39。 cout) ,setw(9)setfill(39。 }//檢測( else if(a[m]==39。 m++。)zbbm,endl。) { zbbm=8。 39。 } for(int i=0。//怎么輸出地址 cout。39。39。 } else {k++。amp。 } if(r!=j) { k++。(y==1)) { r=0。 weizhi=1。 j++。 if(n==0) { j=0。 m++。 39。amp。amp。amp。)zbbm,endl。(what(a[m+4])==2)) { m=m+4。(a[m+3]==39。(a[m+2]==39。(a[m+1]==39。 }//檢測 then else if((a[m]==39。 zbbm=3。n39。e39。h39。t39。 coutif ,setw(9)setfill(39。)amp。)amp。 39。amp。amp。amp。amp。amp。)zbbm,dendl。 39。 } static int d=0。) { cout遇到空格 endl。 int
點(diǎn)擊復(fù)制文檔內(nèi)容
醫(yī)療健康相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1