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

后端 未结 3 1669
天命终不由人
天命终不由人 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.

提交回复
热议问题