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

2024-05-07

我想尝试一下莎士比亚编程语言 http://shakespearelang.sourceforge.net/report/shakespeare/,所以我从here http://shakespearelang.sourceforge.net/并使用执行 Makefilecd spl-1.2.1 Make.

的编译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.2, gcc version 4.2.1 (Apple Inc. build 5646) (dot 1), flex 2.5.35, and bison (GNU Bison) 2.3.

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


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

我分叉了语言。 http://bitbucket.org/kcartmell/marlowe

我解决了这个问题。 http://bitbucket.org/kcartmell/marlowe/issue/1/roman-number-ii-interpreted-as-i

我通知了原作者。 http://twitter.com/KyleCartmell/status/13654952949850114

这是该语言的一个版本,其中包含修复程序,供您欣赏。 http://bitbucket.org/kcartmell/marlowe/downloads/marlowe-1.0.tar.gz

仍有一些警告 http://bitbucket.org/kcartmell/marlowe/issue/2/fibonacci-example-builds-with-warnings,但它们似乎没有影响任何事情。让我知道 http://bitbucket.org/kcartmell/marlowe/issues/new如果您发现任何其他功能问题,我会看看如何处理它们。

(罗菲尔 - 这将是死灵术,如果不是因为没有人关心这个问题。)

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

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

随机推荐