递归下降解析器:如何找到 FIRST、FOLLOW 和 PREDICT 集?

发布于 2024-07-14 08:58:47 字数 56 浏览 4 评论 0原文

我正在寻找给定语法时 RDP 的 FIRST、FOLLOW 和 PREDICT 集定义的良好解释。

I'm looking for a good explanation of the definitions of the FIRST, FOLLOW, and PREDICT sets of a RDP when given a grammar.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

殤城〤 2024-07-21 08:58:47

尝试《编程语言语用学》,作者:Michael L. Scott(Morgan Kaufmann)。 第 2 章介绍了解析。第 2.2.3 节描述了递归下降解析; 2.2.5 中的firstfollow 集。

Try Programming Language Pragmatics, by Michael L. Scott (Morgan Kaufmann). Parsing is covered in chapter 2. Recursive-descent parsing is described in section 2.2.3; first and follow sets in 2.2.5.

無心 2024-07-21 08:58:47

您可以使用计算预测集、第一集和跟随集自动计算第一集、跟随集和预测集来自 BNF(巴科斯诺尔范式)语法规范,无需下载任何内容。 这是验证答案或自动化繁琐工作的好方法。

如果您想手动执行此操作,Dragon Book(第二版)涵盖见第 221-222 页。

You can automatically calculate first, follow, and predict sets using Calculate Predict, First, and Follow Sets from BNF (Backus Naur Form) Grammar Specification without having to download anything. It's a good way to verify answers or automate the tedium.

If you want to do it manually, the Dragon Book (2nd ed) covers it on pages 221-222.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文