[請益] 關於 Compiler 的一個程式碼問題

看板Programming作者 (寵物貓愛上自由的小猴)時間18年前 (2007/06/02 19:50), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
關於 Compiler 的一個程式碼問題 以下這部分我不太瞭 if E1.type = arith and E2.type = arith then begin /* normal arithmetic add */ E.place := newtemp; E.code := E1.code || E2.code || gen(E.place ':=' E1.place '+' E2.place) end else if E1.type = arith and E2.type = bool then begin E.place := newtemp; E2.true := newlabel; E2.false := newlabel; E.code := E1.code || E2.code || gen(E2.true ':' E.place ':=' E1.place + 1)|| end else if E1.type = arith and E2.type = bool then begin E.place := newtemp; E2.true := newlabel; E2.false := newlabel; E.code := E1.code || E2.code || gen(E2.true ':' E.place ':=' E1.place + 1)|| gen('goto' nextstat + 1)|| gen(E2.false ':' E.place ':=' E1.place) end else if ....................... 希望有高手可以幫忙解釋一下細部內容 我所知道的是第一段是純粹數學運算 第二段是數學和布林函數 感謝 感謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.137.160.182
文章代碼(AID): #16OLbkjP (Programming)
文章代碼(AID): #16OLbkjP (Programming)