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

正文內(nèi)容

編譯原理課程設(shè)計(jì)簡介-閱讀頁

2024-11-14 22:22本頁面
  

【正文】 ”error 0025: 文件在不該結(jié)束的地方結(jié)束了“, ”error 0026: 結(jié)束符出現(xiàn)在不該結(jié)束的地方“, ”error 0027: “,”error 0028: “,”error 0029: “,”error 0030: “, ”error 0031: 數(shù)越界“, ”error 0032: read語句括號中標(biāo)識符不是變量“, ”error 0033: else附近錯(cuò)誤“ , ”error 0034: repeat附近錯(cuò)誤“}。strcpy(word[1],”begin“)。strcpy(word[3],”const“)。strcpy(word[5],”else“)。strcpy(word[7],”if“)。strcpy(word[9],”procedure“)。strcpy(word[11],”repeat“)。strcpy(word[13],”until“)。strcpy(word[15],”while“)。wsym[1]= BEGINSYM。留字對應(yīng)的symbol類型wsym[3]= CONSTSYM。wsym[5]= ELSESYM。wsym[7]= IFSYM。wsym[9]= PROCSYM。wsym[11]= REPEATSYM。wsym[13]= UNTILSYM。wsym[15]= WHILESYM。memset(code,0,sizeof(code))。memset(table,0,sizeof(table))。ssym[39。]= PLUS。39。ssym[39。]= TIMES。/39。ssym[39。]= LPAREN。)39。ssym[39。]= EQL。,39。ssym[39。]= PERIOD。39。ssym[39。]= GTR。39。strcpy(mnemonic[LIT],” lit “)。strcpy(mnemonic[LOD],” lod “)。strcpy(mnemonic[CAL],” cal “)。strcpy(mnemonic[JMP],” jmp “)。(CONSTSYM),(VARSYM),(PROCSYM)。// (IDENT),(NUMBER),(LPAREN)。cc= 0。// 代碼分配指針,代碼生成模塊總在cx所指位置生成新的代碼ll= 0。 39。// 引入此變量是出于程序性能考慮 codeNo=0。fout=fopen(destination,”w“)。sprintf(s,”第 %d 行:“,codeNo)。err= err+1。int i,j,k。 39。// cls space and tab if(isalpha(ch))// id or reserved word {k=0。// 檢測一個(gè)單詞長度 do{ if(k al){a[k]= ch。} getch()。}while(isalpha(ch)||isdigit(ch))。else { do{a[kk]= 39。kk= kk1。} strcpy(id,a)。j= norw。if(strcmp(id, word[k])j= k1。}while(i j)sym= wsym[k]。} else if(isdigit(ch))// number { k= 0。sym= NUMBER。039。getch()。if(k nmax)error(30)。:39。if(ch == 39。){sym= BECOMES。} elsesym= NUL。// extra stuff added to support 39。if(ch == 39。){sym= GEQ。} elsesym= GTR。// 其它符號的賦值getch()。sourceEnd=true。}cc= 0。codeNo++。if(line[ll1]==10)ll。cc= cc+1。}code[cx].f= x。code[cx].a= z。}//gen end// 測試當(dāng)前單詞符號是否合法void PL0::test(symset s1,symset s2,int n){ if(sourceEnd)return。symset::iterator it。it!=()。//s1=s1+s2while((sym)==())getsym()。int dx。// initial table index int cx0。// 變量的個(gè)數(shù) tx0= tx。gen(JMP,0,0)。do{if(sym == CONSTSYM)// 處理常量聲明{getsym()。while(sym == COMMA){}getsym()。} if(sym ==SEMICOLON)getsym()。}while(sym==IDENT)。do{vardeclaration(tx,dx,lev)。vardeclaration(tx,dx,lev)。elseerror(5)。} while(sym ==PROCSYM)// 處理過程的聲明 { getsym()。getsym()。if(sym ==SEMICOLON)getsym()。symset tmp = fsys。block(lev+1,tx,tmp)。symset tmp = statbegsys。i((symbol)i)。}elseerror(5)。(IDENT)。}while((sym)!=())。table[tx0].= cx。cx0= cx。symset tmp=statbegsys。i ((symbol)i)。gen(OPR,0,0)。test(fsys,s2,8)。}// block end// 登入名字表void PL0::enter(obj0 k,int amp。dx,int lev){ tx= tx+1。table[tx].kind=k。num=0。break。table[tx].=dx。break。break。break。strcpy(table[0].name, id)。while(strcmp(table[i].name,id)!=0)i。}//position end// 常量定義處理void PL0::constdeclaration(intamp。dx,int lev){ if(sym == IDENT){getsym()。amp。getsym()。getsym()。}elseerror(3)。}// constdeclaration end// 變量說明處理void PL0::vardeclaration(intamp。dx,int lev){ if(sym == IDENT){enter(VARIABLE,tx,dx,lev)。} elseerror(4)。tx,intamp。getsym()。getsym()。} if(sym == COMMA)getsym()。if(sym == NUMBER || sym == CONSTSYM){downscript = num。} if(sym!= RPAREN)} error(32)。getsym()。if(listswitch)for(i= cx0。int i,cx1,cx2。if(i == 0)error(11)。i= 0。if(sym ==BECOMES)getsym()。expression(fsys,tx,lev)。if(i!= 0)gen(STO,levtable[i].,table[i].)。if(sym!=LPAREN)error(34)。if(sym==IDENT)i=position(id,tx)。if(i==0)error(35)。gen(STO,levtable[i].,table[i].)。}while(sym == COMMA)。while((sym)!=())getsym()。} else if(sym == WRITESYM){ getsym()。symset tmp=fsys。t((symbol)t)。gen(OPR,0,14)。if(sym!=RPAREN)error(33)。} gen(OPR,0,15)。if(sym!=IDENT)error(14)。if(i == 0)error(11)。elseerror(15)。} } else if(sym ==IFSYM){ getsym()。for(int i = THENSYM。condition(tmp,tx,lev)。elseerror(16)。gen(JPC,0,0)。statement(tmp,tx,lev)。code[cx1].a= cx。cx2=cx。code[cx1].a=cx。code[cx2].a=cx。symset tmp=fsys。i((symbol)i)。tmp=statbegsys。while((sym)!=()){if(sourceEnd)return。else if(sym=PERIOD){error(26)。}elseerror(10)。for(i=SEMICOLON。if(sourceEnd)return。statement(tmp,tx,lev)。else if(!sourceEnd)error(17)。// 記下當(dāng)前代碼分配位置,這是while循環(huán)的開始位置getsym()。(DOSYM)。cx2= cx。if(sym ==DOSYM)getsym()。statement(fsys,tx,lev)。code[cx2].a= cx。temp1= fsys,(SEMICOLON),(UNTILSYM)。getsym()。temp2 = statbegsys。while((sym)!= ()){if(sym == SEMICOLON)getsym()。statement(temp1,tx,lev)。condition(fsys,tx,lev)。}elseerror(34)。test(fsys,setT,19)。symset tmp=fsys。t((symbol)t)。amp。getsym()。if(addop ==MINUS)gen(OPR,0,1)。while(sym =PLUSamp。symaddop= sym。term(tmp,tx,lev)。elsegen(OPR,0,3)。symbol mulop。for(int t=TIMES。factor(tmp,tx,lev)。amp。getsym()。if(mulop ==TIMES)gen(OPR,0,4)。} }// term end// 因子處理void PL0:: factor(symset fsys,int tx,int lev){ int i。while((sym)!=()){if(sym ==IDENT){i= position(id,tx)。elseswitch(table[i].kind){case CONSTANT:gen(LIT,0,table[i].)。case VARIABLE:gen(LOD,levtable[i].,table[i].)。case PROCEDURE:error(21)。}getsym()。num= 0。getsym()。symset tmp=fsys。expression(tmp,tx,lev)。elseerror(22)。} }//factor end// 條件處理void PL0::condition(symset fsys,int tx,int lev){ symbol relop。(EQL),(NEQ),(LSS),(LEQ),(GTR),(GEQ)。expression(fsys,tx,lev)。} else {expression(tmp,tx,lev)。else{relop= sym。expression(fsys,tx,lev)。break。break。break。break。break。break。if(err10){coutcoutt= t+1。break。p= s[t+3]。break。break。s[t]= s[t]+s[t+1]。case 3: t= t1。break。s[t]= s[t]*s[t+1]。case 5: t= t1。break。elses[t]=0。case 8: t= t1。elses[t]=0。case 9: t= t1。elses[t]=1。case 10: t= t1。elses[t]=0。case 11: t= t1。elses[t]=0。case 12: t= t1。elses[t]=0。case 13: t= t1。elses[t]=0。case 14: couts[t]。}。case LOD:t= t+1。break。t= t1。case CAL:// generate new block marks[t+1]= base(,b,s)。s[t+3]= p。p=。case INT:t= t+。case JMP:p= 。case JPC:if(s[t] == 0)p= 。break。cout// 通過靜態(tài)鏈求出數(shù)據(jù)區(qū)的基地址int PL0::base(int l,int b,int s[]){ int b1。//find base l levels down while(l0){b1= s[b1]。} return b
點(diǎn)擊復(fù)制文檔內(nèi)容
外語相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1