views:

240

answers:

1

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.

The compilation of spl2c executes with a couple warnings:

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

And then when it attempts to compile all the examples everything goes haywire:

    ../spl/bin/spl2c  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 anybody point me in the right direction for fixing this? My original project was going to be learning spl, not leaning to debug compilers (I'd actually like to write my own compiler eventually, but I'd prefer to stick with my initial project for now).

I'm 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 not requiring gotos (e.g. hello.spl) you can get around the issue by deleting all ACT/SCENE lines except the first ACT I/SCENE I.

+1  A: 

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.

epatel
Thank you, sir.
Lawrence Johnston
Have looked a little now. The scanner seem to mix roman numbers for "scenes" and "acts". Looked into rewriting the grammar to have separate parts but then it mixed with the first person "I" token. Well, I'd say something is depending on the scanner and grammer they used when creating this thing...would have been fun to see working :)
epatel
"scanner and grammer" -- I mean the bison and flex version
epatel
Well, that's a good start. When I have time I may try to take a look at it as well. Or perhaps some other helpful soul will come in and take it up. I agree that it would be entertaining to see working.
Lawrence Johnston