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

正文內(nèi)容

編譯原理課程設(shè)計(jì)c語(yǔ)言編譯器的實(shí)現(xiàn)畢業(yè)論文-免費(fèi)閱讀

  

【正文】 temp=new L。 cout語(yǔ)法分析正確完成!endl。//查go_to表 add(temp)。iq。 add(temp)。 } else if(sr_temp==39。//flag錯(cuò)誤標(biāo)志,0正常移進(jìn),1錯(cuò)誤,2歸約,3結(jié)束 char sr_temp。 } else { temppre=stack_tailpre。L39。F39。D39。 if(ch==39。M39。) j=104。 if(ch==39。}int ID20(char ch)//給非終結(jié)符編號(hào){ int j。) j=8。 if(ch==39。E39。) j=0。 if(i==15) ch=while。 if(i==7) ch=。}string ID10(int i)//反編號(hào)輸入字符{ string ch。 if(i==33) {j=14。 if(i==5) j=4。 /****************************action表和go_to表賦初值完畢************************/}int ID1(int i)//按action表,給輸入字符編號(hào){ int j。 go_to[29][7]=30。 go_to[15][3]=16。 go_to[0][0]=1。r39。action[44][10].state=5。 action[44][5].sr=39。s39。action[42][2].state=45。 action[41][0].sr=39。r39。action[39][1].state=41。 action[38][10].sr=39。r39。action[37][6].state=8。 action[37][3].sr=39。r39。action[36][2].state=10。 action[35][14].sr=39。r39。action[32][0].state=33。 action[30][10].sr=39。s39。action[26][10].state=14。 action[25][0].sr=39。s39。action[21][10].state=18。 action[20][10].sr=39。s39。action[17][10].state=18。 action[16][10].sr=39。s39。action[13][15].state=27。 action[13][0].sr=39。s39。action[8][3].state=3。 action[6][11].sr=39。s39。s39。j++) action[i][j].sr=39。 css[12].len=3。i++) { char *css_len。N39。 css[16].left=39。M39。 css[10].right=id。 css[8].left=39。E39。D。 css[0].right=P。 stack_headnext=stack_tail。 if(p==1) break。 temp=token_headnext。 }}/////////////////////////////////////////語(yǔ)法分析子程序void yufa_main(){ if(err==0) { system(pause)。 if(temp1num == 1) fout1endl。 while(temp3!=NULL) { couttemp3num temp3wordendl。 while(temp1!=NULL) { couttemp1code。 }}void input3(str *temp){ if(string_headnext == NULL) { string_headnext=temp。 } else if(flag==2 || flag==3) out3(ch,word)。 } else if(flag==4 || flag==5 || flag==6) { wordcount++。 } else if(flag==1) { wordcount++。 else if(word==if) tempcode=32。 temp1num=1。 return。break。break。break。break。break。}void out1(char ch){ int id。) flag=4。A39。) flag=1。 || ch==39。 || ch==39。 else { coutnl行 錯(cuò)誤:非法字符! chendl。 cout無(wú)法找到該文件!endl。 int flag=0。 cout,請(qǐng)打開(kāi)查看endl。 if(err==0) { char m。 symb_tail=new symb。 L_four_tailk=0。 token_tailnext=NULL。//語(yǔ)法 output_yuyi()。 cout* 說(shuō)明: *endl。//變量聲明檢查/////////////////////////////////全局變量的聲明FILE *fp。//語(yǔ)義分析主程序void add_L_four(L *temp)。//語(yǔ)法分析主體部分int ID1(int a)。//void out3(char ch,string word)。//變量地址 symb *next。//操作數(shù) string result。//狀態(tài) int word。ivan css[20]。//編號(hào) string word。while cccd do a=d。同時(shí)也培養(yǎng)了自己熱愛(ài)思考,勤查資料的習(xí)慣。 if pnil then emit(p’:=’) else error。}B→B and BB→B1 and A B2{backpatch(,)。Emit(’:=’’+’)。對(duì)于有規(guī)約動(dòng)作和接受的狀態(tài),將其特別標(biāo)明。R 7. P→id()L。,+,),*,}B { id } {then,do,and}M { id } { },。流程圖如下: 詞法分析流程圖四. 語(yǔ)法分析.源程序中涉及的文法G[P]定義如下表:說(shuō)明語(yǔ)句表達(dá)式布爾表達(dá)式句法0、P’→PP→id () L。然后對(duì)它進(jìn)行詞法,語(yǔ)法,語(yǔ)義分析,并輸出匯編代碼。二. 程序適用范圍 本程序的使用范圍為:整型常量,四則運(yùn)算(為了簡(jiǎn)化問(wèn)題,本程序只考慮加法運(yùn)算和乘法運(yùn)算)和布爾表達(dá)式以及相應(yīng)的賦值語(yǔ)句,條件轉(zhuǎn)移語(yǔ)句和循環(huán)語(yǔ)句。 }E {(,id } { },。R 4. P→id(.)L。.D 12. L→L。:*+={}intandifthenwhiledo$PDRETFBMSLN0123456789101112131415161701234567891020r17r1721r18r1822r16r1623s312424s34s2525s142626r14r1427s312828s3429s14s293030r15r1531s3232s3333r12r12r1234s313535r11r11r1136r10r10r10r10r1037r8r8r8r8r838r6r6s39r6r639s36s4140G[P]:SLR(1)分析表actiongotoid()。}F→(E)F→(E){:=。 emit(if ’’’goto_ _’)。ST R , T. ( *, A , B , T ) →MOV R ,A ;MUL R ,B 。ccc:int。}。//產(chǎn)生式的左部 string right。//action表int go_to[46][11]。 string op。L *L_four_head,*L_four_tail,*L_true_head,*L_false_head。//按字符讀取源文件void cifa_main()。//輸出三個(gè)隊(duì)列的內(nèi)容到相應(yīng)文件中////////////////////////////////語(yǔ)法分析有關(guān)函數(shù)聲明void yufa_main()。//給非終結(jié)狀態(tài)反編號(hào)void add(ike *temp)。//輸出中間代碼四元式和最后符號(hào)表string newop(int m)。//語(yǔ)義臨時(shí)變量string E_name,T_name,F_name,M_name,id_name,id1_name,id2_name,errword。 cout************************endl。}//////////////////////////////////詞法分析子程序void cifa_main(){ token_head=new token。//初始化三個(gè)隊(duì)列的首尾指針 L_four_head=new L。 L_false_headLfalse=NULL。//初始化字符計(jì)數(shù)器 err=0。 if(m==39。 char ch。 cout* 第一部分:詞法分析 *endl。 if(flag==1) out1(ch)。=39。:39。(39。 ch=39。)) flag=3。//換行 nl++。 case 39。 case 39。 case 39。 case 39。 case 39。 tempnum=1。 tempnext=NULL。 ch=fgetc(fp)。//關(guān)鍵字編碼 input1(temp)。 temp1word=word。 temp1word=word。 token_tailnext=temp。 token *temp1。 str *temp3。 temp1=new token。 temp3=string_headnext。 yufa_initialize
點(diǎn)擊復(fù)制文檔內(nèi)容
規(guī)章制度相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1