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

正文內容

編譯課程設計報告-文庫吧資料

2025-01-27 18:06本頁面
  

【正文】 as deleted*/ LeftID = pt1ID。i=Line_Num。 } printf(END\n)。 while(pt1){ printf(%d,pt1ID)。i++){ pt1 = pprotemp[i]。 } }/*ifdef DEBUG for(i=0。 pt2ID = pt1ID。 pt2next = CreateNewIDNode。 pt2next = NULL。 *(pprotemp+i) = pt2 = CreateNewIDNode。i=Line_Num。i++){ *(pprotemp+i)=NULL。 /*for printing*/ for(i=0。/*temp pointers*/ int ifVnChanged。 IDNode **pprotemp=(IDNode**)malloc(sizeof(IDNode*)*(Line_Num+1))。}void getNULLVn(){/*to decide the Vn that can deduct,the result is stored in Vn[] amp。}39。 } if(r) printf(})。 /*r stores the result*/ } pt2 = pt2next。 mark = 1。*/ else printf({)。 /*if not the first, print 39。 while(pt2){ ID2 = pt2ID。,39。 /*mark notes if it39。 } } }/*while*/}int ifCross(IDNode *p1,IDNode *p2){/*judge if p1 p2 has the same node,if has then print out in the form of {.,.,.}*/ IDNode *pt1=p1,*pt2=p2。 } else{ *ifgetnull = 0。phead,FirstVn[pExpID100],0,0)。*/ return phead。)) *ifgetnull = 1。amp。 *ifgetnull=0。 insert2link(amp。 ptID = pExpID。 return phead。/*point to the new created link*/ IDNode *pt。 in the return link*//*ifgetnull returns whether the exp can = amp。amp。 } return 1。amp。i++){ pt=*(pprotemp+i)。 for(i=0。s expression no,mark it NO*/ IDNode *pt。 pt = ptnext。amp。 printf(%c,ch)。 if(num=200) ch = Vt[num200].Tch。 char ch。 *(pprotemp+i)=NULL。amp。i++){ pt=*(pprotemp+i)。 for(i=0。s expression*/ IDNode *pt。 free(pt)。 while(p){ pt=p。 } return mark。 mark=insert2link(pdes,pt,1)||mark。 } ps = psnext。 else { pt = CreateNewIDNode。39。 while(ps){ if(ifcopyNULL||(psID!=NULLID)){/*about 39。)。amp。 return 0。 return 1。 } if(ptID!=cID){ ptnext = ptd2。 if(ptd2) cID = ptd2ID。(ptIDcID)){ ptd1 = ptd2。 /*if at the tail*/ while(ptd2amp。 if(ptd2) cID = ptd2ID。 } } else{ ptd1 = *pdes。 } else{ if(iffreeit) free(pt)。 *pdes = pt。 return 1。 } ptnext = NULL。t change it,so copy a new one*/ pt = CreateNewIDNode。int cID。 }}endifint insert2link(IDNode **pdes,IDNode *pNode,int iffreeit){ /*insert pNode to *pdes,with the order small to large*/ /*no same 2, if can39。 pt=ptnext。 printf(%d.,i)。i=Line_Num。 } printf(\n)。iVt_ID_next200。 } printf(\n)。iVt_ID_next200。 } printf(\n)。iVn_ID_next100。 } printf (\n)。iVn_ID_next100。 IDNode *pt。 getch()。 ch = fgetc(fp)。 ch = fgetc(fp)。 printf(File Content: (Press any key to continue...)\n)。 } return OK。 pnewnode = pt。 ppro[Line_Num] = pnewnode = pt。 ptnext= NULL。 } if (ifavailable){/*to be transformed*/ pt = CreateNewIDNode。 Vt_ID_next++。 /*get the id of ch*/ if (idcurrent == Vt_ID_next){ Vt[Vt_ID_next200].ID = Vt_ID_next。39。){/*carriage return*/ pnewnode = NULL。 /*notes to be transformed*/ } else if (ch==39。 Vn_ID_next++。 /*get the id of ch*/ if (idcurrent==Vn_ID_next){ Vn[Vn_ID_next100].ID = Vn_ID_next。Z39。amp。A39。/*left part*/ pnewnode = NULL。 means a new expression*/ ifavailable = 1。){ /*for example SAB|bC,39。 /*to get ready*/ if (ch==39。 ch = fgetc(fp)。 /*pointer to the last node*/ IDNode *pt。 int ifavailable。}Status File_Input (FILE *fp) { /*read file fp points to, get all fags,and transform the oriental words to the form that the syntax analyser can read which is stored in ppro[]*/ char ch。 break。iVt_ID_next100。}int SeekoverVt(char ch){ /*scan vt, if ch in,then return its id,else return Vt_ID_next*/ int i=0,r = Vt_ID_next。 break。iVn_ID_next100。}int SeekoverVn(char ch){ /*scan vn, if ch in,then return its id,else return Vn_ID_next*/ int i=0,r = Vn_ID_next。 if(i==0) i = getVtID(ch)。}int getID(char ch){/*get the ID of V*/ int i。i++){ if (Vt[i].Tch==ch) return Vt[i].ID。 for (。 } return 0。iVn_ID_next100。 }}int getVnID(char ch){/*get the ID of Vn according to itselt*/ int i=0。 Follow[i] = NULL。 FirstVn[i] = NULL。i++){ ppro[i]=NULL。 /*Vt 200...299*/ for (i=0。 /*special used in input*/ Vn_ID_next = 100。參考文獻1 呂映芝,張素琴,:清華大學出版社,1998附 錄源程序include include include include e:\include /*define DEBUG*/void initiate(){ int i??偟膩碚f,雖然這些不足不影響程序對LL(1)文法判定的演示和教學效果,但是其判定功能卻因為這些不足而被大大削弱。希望以后能有更多的機會得以鍛煉和施展才能。這樣的做法,既提高的程序的開發(fā)效率和運行效率,又增強了程序運行的穩(wěn)定性,此外,還大大提高了程序的可重用性。第五章 結 論 系統結論本設計用C語言成功實現了對LL(1)文法的判定,達到了課程設計題目中的所有要求,并且操作簡單、易上手,輸出結果清晰明了,可以作為《編譯原理》初學者的學習工具,也可以作為《編譯原理》課上的演示程序。圖49如圖中最后一行所示, i+i*i是該文法的句子。圖48如圖48所示,經程序判定,該輸入文法是LL(1)文法?!贝妫?。 圖44如圖44所示,經程序判定,該輸入文法不是LL(1)文法?!贝妫) 若判定為LL(1)文法,則輸出預測分析表,并提示輸入符號串進行語法分析。b) ,按照屏幕提示,輸入文法文件的路徑和文件名。}pa_table。 int *row_info,*col_info。該過程由函數getpa_table()實現,該函數以Select[]為輸入數據,計算所得分析表存儲在結構體pa_table的變量中。a∈SELECT(A→α),則把α的頭指針放入M[A,a]中。矩陣的元素M[A,a]中的下標A表示非終結符,a為終結符或句子括號“”,矩陣元素M[A,a]中的內容為一條關于A的產生式,表明當用非終結符A向下推導時,面臨輸入符a時,所應采取的候選產生式,當元素內容無產生式時,則表明用A為左部向下推導時遇到了不該出現的符號,因此元素內容為轉身出錯處理的信息[1]。該過程由函數judgeLL1()實現。定義如下:/*LL(1).h*/IDNode *Select[100]。該過程由函數getSelect()實現。詳見附錄源程序。該過程由函數getFollow()實現。由此算法可計算出非終結符號的FOLLOW集,存儲在Follow[]中。如果βε則把FOLLOW(A)也加入FOLLOW(B)中。 求解非終結符的FOLLOW集算法如下:對文法中每一A∈VN計算FOLLOW(A)a) 設S為文法中開始符號,把{}加入FOLLOW(S)中。 該過程分別由函數getFirstVn()和getFirstRight()實現,兩者又調用了兩個鏈表操作函數insert2link()和add2link()以及一個輔助函數getFirstExp()來實現具體功能,后三都的功能分別為插入結點到單鏈表、拷貝單鏈表到另一單鏈表、得到任意字符串的FIRST集。定義如下:/*LL(1).h*/IDNode *FirstVn[100]。若對任何j( 1≤j≤i1,2≤i≤n),ε∈FIRST(Xj)則FIRST(α)=(FIRST(Xj){ε})∪FIRST(Xi)當所有FIRST(Xj)( 1≤j≤n)都含有ε時,則FIRST(α)=(FIRST(Xj))∪{ε}[1]。求出每個文法符號的FIRST集合后也就不難求出一個符號串的FIRST集合。e) 當d)中所有Yi ε,(i=1,2,…n)則FIRST(X)=FIRST(Y1)∪FIRST(Y2)…∪FIRST(Yn)∪{ε}。a) 若X∈VT,則FIRST(X)={X}b) 若X∈VN,且有產生式X→a…,a∈VT則a∈FIRST(X)c) 若X∈VN,X→ε,則ε∈FIRST(X)d) 若X∈VN,Y1,Y2,…,Yi都∈VN,而有產生式X→Y1Y2…Yn。 求解產生式的右部的FIRST集首先,計算每個文法符號的FIRST集。)[1]該過程由函數getNULLVn()實
點擊復制文檔內容
研究報告相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1