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

正文內(nèi)容

[工學(xué)]第7章語(yǔ)義分析-文庫(kù)吧資料

2024-10-25 00:25本頁(yè)面
  

【正文】 e 若 E為 E1 and E2,:= : 44 E→ id 1 relop id2 E → E 1 and E2 E → E 1or E2 :=。 Gen(39。goto‘next+3’ ) 。if39。 Gen(’:=’ ‘not’ } {:=} { :=newtemp。 40 布爾表達(dá)式的作用: (1)計(jì)算邏輯值 (2)用在控制語(yǔ)句中 如: a or b and c 的三地址代碼: T1:=b and c T2:=a or T1 如: ab 的三地址代碼: 1: if ab goto 4 2: T:=0 3: goto 5 4: T:=1 5: 41 E → E 1 and E2 E → E 1 or E2 E → not E 1 E → (E) E → id 1 relop id2 下一條語(yǔ)句的地址 翻譯模式 { :=newtemp。 B: array[1..2,1..3]of integer。 gen(?:=? )。:=m} {:=newtemp。 :=。 gen(t?:=??*?limit(,m))。 :=} {t:=newtemp。 :=null} 38 Elist→id[E Elist→Elist 1,E L→Elist] {:=。gen(?:=?[])} {:=newtemp。 (2)若 L是數(shù)組引用,則數(shù)組地址為[ ] ; ? 是下標(biāo)表達(dá)式個(gè)數(shù); ?; ?; ?函數(shù) limit(array,j)返回?cái)?shù)組第 j維的長(zhǎng)度。 39。 39。 := E → id := 。:=39。) ? 注釋?zhuān)? || 表示代碼序列的連接 30 E → E1 := newtemp。39。 := || || gen(39。+39。:=39。 ) E → E 1 + E2 := newtemp。 push(0,offset)} 28 基本子程序 ?產(chǎn)生一條中間代碼 gen(code) ?產(chǎn)生新的臨時(shí)變量 newtemp 屬性設(shè)置 ?中間代碼序列 code ?存儲(chǔ)位置 place 29 賦值語(yǔ)句的四元式翻譯 S → id := E := || gen( 39。Enterproc(top(tblptr), ,t)} {t:=mktable(top(tblptr))。addwidth(t, top(offset))。 push(0,offset)} {enter(top(tblptr), , , top(offset) )。 pop(offset)} {t:=mktable(nil)。S N→ ? { addwidth(top(tblptr), top(offset))。 27 P → MD M → ? D → id : T D → proc id。 ?Addwidth(table,width):將 table 所指表中所有名字占用的總寬度記錄在表頭。D。D。 D { offset := 0 } 25 過(guò)程說(shuō)明的翻譯 文法描述 P → D D → D 。 i:integer 的翻譯 insert(x,real,0) offset=0 offset=8 =real =8 offset=12 =integer =4 insert(i,integer,8) 24 ? 為了使所有的語(yǔ)義動(dòng)作都在規(guī)則式末尾,從而實(shí)現(xiàn)自底向上的計(jì)算屬性值,在文法中引進(jìn)標(biāo)記非終極符 說(shuō)明語(yǔ)句的翻譯模式 P → D D → D 。 := 4} 23 id :re a lTD 。 := 8} { := array( , )。 offset := offset + } { := integer。 …… end 21 屬性、過(guò)程、與全局量 ? 類(lèi)型 T的屬性 – type 類(lèi)型 – width 占用的字節(jié)數(shù) ? 基本子程序 – insert:設(shè)置變量的類(lèi)型和地址,填表 – array:數(shù)組類(lèi)型處理 ? 全局量 – offset:已分配空間字節(jié)數(shù) 22 P → D D → D 。 c:array[10]of real 定義整型數(shù)據(jù)占 4 BYTE; 實(shí)型數(shù)據(jù)占 8BYTE; 19 變量說(shuō)明的翻譯 ? 在符號(hào)表中填寫(xiě)變量的屬性 – 種別、類(lèi)型、相對(duì)地址、作用域 …… 等 ? 相對(duì)地址 – 全局變量表示為靜態(tài)數(shù)據(jù)區(qū)的相對(duì)于基址偏移值 (offset) – 局部變量表示為局部數(shù)據(jù)域的偏移值 20 例 71:相對(duì)地址舉例 ? 名字 相對(duì)地址 ? x 0 ? i 64 ? j 68 X[1] X[2] …… X[8] i j 0 8 56 64 68 Begin real x[8]。 D D → id : T T → integer T → real T → array[num] of T1 T → ^T 1 例如: a:integer。 E .c o d e := id .na m e E .pl a c e :=n u m .pl a c e 。 E .c od e : = E1.c od e | | ge n ( lace ? := ? ? ? E lace ) E .pl a c e := la c e 。 E .c o d e := E1.c o d e | | E2.c o d e | | g e n ( a c e ? := ? E 1 .pl a c e ? + ? E 2 .pl a c e ) E .pl a c e :=n e w tem p 。 P6:= mknode(?:=?,mkleaf(x,),p5) 12 一般形式 x := y op z – 其中 x, y, z 為變量名、常數(shù)或編譯產(chǎn)生的臨時(shí)變量 – 四元式( op, y, z, x) – 三元式( op, y, z) 種類(lèi): x := y op z 雙目運(yùn)算 x := op y 單目運(yùn)算 x := y 復(fù)制語(yǔ)句 13 其它語(yǔ)句的三地址代碼 if x relop y goto l 條件轉(zhuǎn)移語(yǔ)句 goto l 無(wú)條件轉(zhuǎn)移 param x 實(shí)在參數(shù) call p, n 過(guò)程調(diào)用
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1