Compiling and translating the Shakespearean spl2c translator programming language on Mac OS X 10.6 leads to warnings / errors

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

The compilation of spl2c is performed with two warnings:

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

And then when he tries to compile all the examples, everything goes on haywire:

 ../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. 

Can someone point me in the right direction to fix this? My original project was going to learn spl and not debug debugging compilers (I really would like to write my own compiler in the end, but now I would rather stick to my original project).

I am running 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 .

EDIT: For simple programs that do not require gotos (e.g. hello.spl), you can work around this problem by deleting all ACT / SCENE lines except the first ACT I / SCENE I.

+7
flex-lexer bison yacc macos shakespeare-lang
source share
3 answers

This is a regular expression defect in the lexical parser.

I branched out my tongue.

I fixed the problem.

I notified the authors of the original.

Here is a language release that includes a fix for your enjoyment.

There are a few more warnings , but they do not seem to affect anything. Let me know if you find any other functional issues, and I'll see what I can do with them.

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

+22
source share

This problem occurs due to an error in Flex introduced somewhere between versions 2.5.4 and 2.5.33; that is, between the time when the Shakespeare processor was written, and this question was asked. The error is due to the use of the operator with continuous repetition with single-character arguments in a case-insensitive regular expression (for example, i{1,3} , which is part of the Flex Shakespeare specification for Roman numerals); the consequence of the error is that case insensitivity is lost, so i{1,3} expands as if it were [iI]i?i? instead of [iI][iI]?[iI]? . This means that lowercase Roman numerals with duplicate characters (which is normal in Shakespeare's source code) will not be correctly identified.

Changing Kyle Cardmell in Marlowe uses uppercase letters in a regular expression instead of a lowercase, which inverts the problem, so only Roman uppercase numbers are reliable.

I reported a Flex error as https://github.com/westes/flex/issues/193 . This is a one-liner patch for Flex if anyone needs it before the official release.

+3
source share

The first problem with scanner.l:600: warning, rule cannot be matched is that the word rotten was added two times to the include/negative_adjective.wordlist file, just removing it from there, and the first warning will be deleted. However, this does not eliminate the rest. Take a look here if I can fix anything else.

+1
source share

All Articles