作者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