Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
根据Recursive Descent vs. LALR 中的这篇文章,任何 LALR(k) 都可以通过“因式分解”转换为 LALR(1)。我不拥有帖子中提到的龙之书,在线某处是否有一些解释或示例,或者有人可以在这里提供如何进行分解的解释或示例?
龙书只提到了这个定理,并说它被证明了。它没有提供任何进一步的细节。该语句的要点是 LR(k) 解析器并不比 LR(1) 好。这就是为什么在任何地方都使用 LR(1) 解析器的原因。
你最初的目标是什么?你已经有 LR(k) 语法了吗?