[請益] 有 compiler 達人嗎? Orz
看板Prob_Solve (計算數學 Problem Solving)作者itchy (Lucky we love you.)時間16年前 (2008/06/27 19:18)推噓1(1推 0噓 4→)留言5則, 1人參與討論串1/1
這個問題我一直想不透. 痛苦極了啊~~ Orz (抓頭)
問題如下:
Assume G is an LR(0) grammar.
Let F --> ε be a production that is not currently in G.
Assume F is a nonterminal that is already in G.
Let G* be the new grammar obtained from G by inserting the new production
F --> ε. Describe the possible impacts (in the areas of conflicts,
expressive power and parsing complexities) of adding this new production.
========= 痛苦分隔線 ===============
我怎麼想都覺得不會有影響啊 (哭)
舉例來說, 若原本的 grammar:
E' --> E
E --> E + T
T --> T * F
F --> (E) | id
加了 ε的 grammar: (舉例來說)
E' --> E
E --> E + T | ε
T --> T * F
F --> (E) | id
則最後的 LR(0) sets 也不會變啊.
有誰知道到底有什麼影響嗎? Orz
頭髮都快抓光了 (繼續抓頭.. Q_Q)
大感謝 Orz
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.160.33.61
推
06/28 08:45, , 1F
06/28 08:45, 1F
→
06/28 08:45, , 2F
06/28 08:45, 2F
→
06/28 08:46, , 3F
06/28 08:46, 3F
→
06/28 08:47, , 4F
06/28 08:47, 4F
→
06/28 08:48, , 5F
06/28 08:48, 5F
Prob_Solve 近期熱門文章
PTT數位生活區 即時熱門文章