我碰到了一个由助教解答的旧试题。有人能帮我吗?
当我们创建关于SLR(1)语法的S--> aSb | a时,其中一个项集LR(0)如下所示:
{S->a.Sb,S->a.,S->.a.Sb,S->.a}
关于从上述集合中提取规则,其中哪个是真规则:
a) one reduced and 2 shift and 1 goto is produced.
b) one reduced and 2 shift and2 goto is produced.
c) two reduced and 1 shift and 1 goto is produced.
d) when we input a, we have conflict. 任何人都可以说为什么(3)是正确的?关于这个问题的一些细节?
编辑:我认为Goto指的是Action和goto表。

发布于 2015-03-12 20:17:28
有三个可能的前瞻性符号:a、b和$ (输入结束标记)。过渡是:
lookahead action
--------- ------
a shift
b reduce S->a
$ reduce S->a在非终端S上产生一个goto动作,目标是状态{S -> aS.b}
https://stackoverflow.com/questions/29018281
复制相似问题