[請益] 有 Compiler 達人嗎? Orz
看板Programming作者itchy (Lucky we love you.)時間17年前 (2008/06/27 19:20)推噓0(0推 0噓 5→)留言5則, 2人參與討論串1/3 (看更多)
這個問題我一直想不透. 痛苦極了啊~~ 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/27 20:14, , 1F
06/27 20:14, 1F
→
06/27 20:15, , 2F
06/27 20:15, 2F
→
06/27 20:15, , 3F
06/27 20:15, 3F
→
06/28 16:07, , 4F
06/28 16:07, 4F
→
06/28 16:08, , 5F
06/28 16:08, 5F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 3 篇):