如何构建LL(k>1)的解析表?
在网络上,有很多示例展示了如何从 LL(1) 解析器的第一个/后续集合构建上下文无关语法的解析表。
但我还没有发现任何与 k>1 案例相关的有用信息。甚至维基百科也没有提供有关此的信息。
我预计它一定在某种程度上相似,但是指向该领域现有研究的指针将会非常有帮助。
On the web, there is a lot of examples showing how to construct parsing tables for a context-free grammar from first/follow sets for LL(1) parser.
But I haven't found anything useful related to k>1 cases. Even wikipedia gives no info about this.
I expect that it must be in some way similar, but pointers to existing research in this area would be very helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在同样的问题上遇到了很大的困难,构建 LR 解析器,而不是 LL。我发现了一个比 @cakeplus 提到的 LL(k) 更好一点的页面 -- http://www.seanerikoconnor.freeservers.com/ComputerScience/Compiler/ParserGeneratorAndParser/QuickReviewOfLRandLALRParsingTheory.html 还有免费提供的相关论文 -- http://ci.nii.ac.jp/naid/110002673618/
然而,即使这些也对我没有多大帮助。所以我从基础开始。如果有人感兴趣:https://aboutskila.wordpress.com/2013 /06/14/lalrk-first-sets/ 战斗将继续:-)
I struggle pretty much with the same issues, building LR parser, not LL though. I found a little better page than LL(k) mentioned by @cakeplus -- http://www.seanerikoconnor.freeservers.com/ComputerScience/Compiler/ParserGeneratorAndParser/QuickReviewOfLRandLALRParsingTheory.html There is also related paper available for free -- http://ci.nii.ac.jp/naid/110002673618/
However even those didn't help me much. So I started myself from the basics. If anyone is interested: https://aboutskila.wordpress.com/2013/06/14/lalrk-first-sets/ and the battle will continue :-)