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

我想试试 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.2,gcc版本4.2.1(Apple Inc. build 5646)(第1点),flex 2.5.35和bison(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 – 如果不是因为没人关心这个问题,这将是一种死灵法.)

相关文章
相关标签/搜索