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.
flex-lexer bison yacc macos shakespeare-lang
Lawrence johnston
source share