FsLex 和 FsYacc 的疯狂错误

发布于 2024-09-04 07:35:12 字数 203 浏览 3 评论 0原文

我正在尝试编译这个项目:

http://ramon.org.il/Here.zip

但我遇到了一堆无意义的错误。他们得到了我熟悉的文本,但在该位置没有类似的东西(比如在空行出现意外的“)”)。

请帮助我!

I am trying to compile this project:

http://ramon.org.il/Here.zip

But I get a bunch of non-sense errors. They got text I am familiar with, but in the position there is nothing like that (like unexpected ')' at an empty row).

Help me, please!

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

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

发布评论

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

评论(2

踏雪无痕 2024-09-11 07:35:13

在我看来,错误消息(至少是我检查的第一条)位于正确的行上(但该行上的列无效)。我认为这是一个设计限制,但我不能 100% 确定。

无论如何,文件 LispParser.fsy 的第 25 行对我来说看起来很可疑:

25: ExprList: Expr { List($1, -1, Null) ] }
26:         | Expr ExprList { List($1, -1, $2) }

大括号中的表达式是 List($1, -1, Null) ] 并且有一个结束符方括号 ] 但不是左方括号。所以,我认为支架可能不应该在那里。我没有尝试过,但我认为剩下的错误只是这个问题的结果。

It seems to me that the error message (at least the first one I checked) is on a correct line (but an invalid column on that line). I'd think that this is a by-design limitation, but I'm not 100% sure.

Anyway, line 25 of the file LispParser.fsy looks suspicious to me:

25: ExprList: Expr { List($1, -1, Null) ] }
26:         | Expr ExprList { List($1, -1, $2) }

The expression in curly braces is List($1, -1, Null) ] and there is a closing square bracket ] but not an opening one. So, I think the bracket probably shouldn't be there. I didn't try it, but I think that the remaining errors are just consequence of this issue.

以酷 2024-09-11 07:35:13

很多小错误,我根本不明白它是如何工作的。

托马斯发现的括号是错误之一(拼写错误),但整个概念是错误的。

现在解决了。

Many small mistake, I didn't understand at all how it works.

The bracket Tomas found was one of the mistakes (a typo), but the whole concept was wrong.

Solved now.

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