为什么所有 LL(1) 文法都是 LR(1)?
众所周知,任何 LL(1) 语法也是 LR(1),但我似乎无法在任何地方找到严格的证明。我听过一些对该证明的高级概述(例如,由于 LL(1) 语法一次仅根据一个标记确定其产生式,而 LR(1) 语法可以在做出决定之前扫描更多输入已制成)。然而,在查阅了两本关于编译器和解析的教科书并进行了快速的谷歌搜索之后,我似乎无法找到这一事实的更正式的证明。
有谁知道这个证明,或者至少在哪里可以找到它?
It's a widely-known fact that any LL(1) grammar is also LR(1), but I can't seem to find a rigorous proof of this anywhere. I've heard some high-level overviews of the proof (for example, that since an LL(1) grammar has its productions determined from just one token at a time while LR(1) grammars can have much more input scanned before a decision is made). However, after consulting two textbooks on compilers and parsing and doing a quick Google search, I can't seem to track down a more formal proof of this fact.
Does anyone know this proof, or at least where to find it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
讨论此问题的论文可以在 http://doc.utwente.nl/66947 找到/1/ipl-2_1982.pdf
A paper discussing this can be found at http://doc.utwente.nl/66947/1/ipl-2_1982.pdf