Compiling and executing the Shakespeare Programming Language translator spl2c on Mac OS X 10.6 results in warnings/errors

后端 未结 3 1670
天命终不由人
天命终不由人 2021-02-15 09:39

I wanted to experiment with the Shakespeare programming language, so I downloaded it from here and executed the Makefile using cd spl-1.2.1 Make.

相关标签:
3条回答
  • 2021-02-15 10:12

    This problem results from a bug in Flex introduced somewhere between versions 2.5.4 and 2.5.33; that is, between the time the Shakespeare processor was written and this question was asked. The bug involves the use of the braced repetition operator with single-character arguments in a case-insensitive regular expression (e.g. i{1,3}, which is part of the Shakespeare flex specification for roman numerals); the consequence of the bug is that the case-insensitivity is lost, so that i{1,3} is expanded as though it were [iI]i?i? instead of [iI][iI]?[iI]?. That means that upper-case roman numerals with repeated characters (which is normal in Shakespeare source code) will not be correctly identified.

    Kyle Cartmell's change in Marlowe uses upper-case letters in the regex instead of lower-case, which inverts the issue so that only upper-case Roman numerals work reliably.

    I reported the Flex bug as https://github.com/westes/flex/issues/193. It's a one-line patch to Flex if anyone needs it in advance of the official release.

    0 讨论(0)
  • 2021-02-15 10:12

    The first problem with scanner.l:600: warning, rule cannot be matched is because the word rotten has been added two times to the file include/negative_adjective.wordlist just remove it from there and the first warning will be removed. This does not fix the rest though. Having a look here if I can fix anything more.

    0 讨论(0)
  • 2021-02-15 10:30

    This is a defect in a regular expression in the lexical parser.

    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, but they don't seem to affect anything. Let me know if you find any other functional problems and I'll see what I can do with them.

    (Roffel - this would be necromancy, if not for the fact that nobody cares about this problem.)

    0 讨论(0)
提交回复
热议问题