gpt4 book ai didi

macos - 在Mac OS X 10.6上编译和执行莎士比亚编程语言转换器spl2c会导致警告/错误

转载 作者:行者123 更新时间:2023-12-03 12:29:47 25 4
gpt4 key购买 nike

我想尝试Shakespeare programming language,所以我从here下载了它,并使用cd spl-1.2.1 Make执行了Makefile。

编译spl2c时会出现以下警告:

scanner.l:600: warning, rule cannot be matched
<stdout>:5808: warning: ‘yyunput’ defined but not used

然后,当它尝试编译所有示例时,一切都变得一团糟:
../spl/bin/spl2c < fibonacci.spl > fibonacci.c
Warning at line 19: equality expected
Warning at line 28: equality expected
Warning at line 30: comment expected
Warning at line 30: comment expected
Warning at line 30: comment expected
Warning at line 30: comment expected
Warning at line 32: comment expected
Warning at line 32: comment expected
Warning at line 32: comment expected
Warning at line 32: comment expected
Warning at line 34: comment expected
Warning at line 34: comment expected
Warning at line 34: comment expected
Warning at line 34: comment expected
Warning at line 36: comment expected
Warning at line 36: comment expected
Warning at line 37: comment expected
Warning at line 37: comment expected
Warning at line 37: comment expected
Warning at line 37: colon expected
Warning at line 40: equality expected
Warning at line 51: comment expected
Warning at line 51: comment expected
Warning at line 51: comment expected
Warning at line 51: comment expected
Warning at line 51: comment expected
Warning at line 51: colon expected
Error at line 59: 'act [roman number]' or 'scene [roman number]' expected
1 errors and 27 warnings found. No code output.

有人可以指出我正确的方向进行修复吗?我最初的项目将学习spl,而不是倾向于调试编译器(我实际上想最终编写自己的编译器,但现在我更喜欢坚持最初的项目)。

我正在运行 OS X 10.6.2gcc version 4.2.1 (Apple Inc. build 5646) (dot 1)flex 2.5.35bison (GNU Bison) 2.3

编辑:对于不需要gotos的简单程序(例如hello.spl),您可以通过删除除第一个ACT I/SCENE I之外的所有ACT/SCENE行来解决问题。

最佳答案

这是词法分析器中正则表达式的缺陷。

I forked the language.

I fixed the issue.

I notified the original authors.

Here's a release of the language that includes the fix for your enjoyment.

There are still a few warnings,但它们似乎没有任何影响。 Let me know,如果您发现任何其他功能问题,我将为您解决。

(Roffel-如果不是没有人关心这个问题的事实,这将是死法。)

关于macos - 在Mac OS X 10.6上编译和执行莎士比亚编程语言转换器spl2c会导致警告/错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1948372/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com