作者andy74139 (月^4)
看板NTU-Exam
標題[試題] 99下 陳俊良 編譯程式設計 期末考
時間Thu Jun 23 21:04:47 2011
課程名稱︰編譯程式設計
課程性質︰系必修
課程教師︰陳俊良
開課學院:電資學院
開課系所︰資訊工程學系
考試日期(年月日)︰ 2011/06/23
考試時限(分鐘): 120分鐘
是否需發放獎勵金:是
(如未明確表示,則不予發放)
試題 :
1. Symbol table in a compiler is a logic concept. It can be implemented by any
possible data structures, e.g., arrays, linked lists, binary search trees,
hash tables, and so on. Please compare using arrays and hash tables to
implement symbol tables? (20%)
2. What is the purpose of the root set for a garbage collector? Why does it
include the data in static memory and the data in stack memory? (10+10%)
3. SSA (Static Single Assignment) form is a very popular IR for compiler
optimization. What is the SSA? Why does its name emphasize``static''?
(10+10%)
4. Peephole optimization is a fundamental strategy to do compiler local
optimization. What is the peephole optimization? How does GCC implement
it? (10+10%)
5. This grammar generates binary numbers with a ``decimal'' point:
S → L . L
L → B L
L → B
B → 0
B → 1
Design an L-attributed SDT to compute S.val, the decimal-number value of an
input string. For example, the translation of string 101.101 should be the
decimal number 5.625. (20%)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.30.140
1F:→ andy74139 :已收錄至資訊系!! 06/23 21:06
2F:推 s864372002 :自PO自收XD! 06/23 21:07