《編譯原理》閱讀筆記:p19-p24

codists發表於2024-06-25

《編譯原理》學習第 4 天,p19-p24總結,總計 5 頁。

一、技術總結

1.grouping of phases

這裡談到分組(group),那麼就會有一個疑問,分組的依據是什麼?即根據什麼來分組。

(1) front end & back end

編譯器包含很多階段(phase)——lexical analyzer, syntax analyzer, semantic analyzer, intermediate code generator, code optimizer, code generator, 這些階段可以分為front end和back end兩組。這裡是根據phase的作用進行分組——“The front end consists of those phases, or parts of phases, that depend primarily on the source language and are largely independent of the target machine”。

(2)pass

可以將多個phase分成一個pass。分組的依據是什麼?暫時沒有理解,先繼續往下讀。

2.compiler-construction tools

有哪些tool,這些tool的作用是什麼。這裡只需要大概瞭解即可,用到的時候自然會知道。

3.參考文獻

本書會在最後Bibliography章節列出所有的參考文獻,翻了一下Wexelblat在1981年寫的《history if programming languages》,介紹了FORTRAN,LISP,COBOL等程式語言,果然歷史久遠。

二、其它

p24, Ascribing credit for techniques remains a perilous task。這句話初看不好理解,ascribe: xxx的原因,credit: 讚譽,perilous: 危險的。中譯版將“ascribing credit”翻譯成“論功”,甚是準確,但是翻譯成“為編譯技術論功是一項艱難的任務”,卻有點生硬,我個人覺得應該將其翻譯成“這些編譯技術歸功於誰?這真不好下結論,因為同一個技術,有時候確實是不同的人都發現了。”

四、參考資料

1. 程式設計

(1)Alfred V. Aho,Monica S. Lam,Ravi Sethi,Jeffrey D. Ullman,《編譯原理(英文版·第1版)》:https://book.douban.com/subject/5416783/

2. 英語

(1)Etymology Dictionary:https://www.etymonline.com

(2) Cambridge Dictionary:https://dictionary.cambridge.org

歡迎搜尋及關注:程式設計人(a_codists)

相關文章