New books from Apress

Andy Armstrong andy at hexten.net
Wed May 24 21:31:48 BST 2006


On 24 May 2006, at 21:20, Peter Corlett wrote:
> My own attempt at this rather silly retro game has produced a skeleton
> flex/bison[0] pair for BBC BASIC. The language itself seems regular  
> enough to
> parse, but I think I'm going to have to omit the assembler for now.

I imagine it'd be tricky to match the exact semantics of the  
tokeniser without a bit of bodgery. If you get as far as wanting to  
interpret BBC Basic you need to remember that FOR .. NEXT, REPEAT ..  
UNTIL, PROC .. ENDPROC and FN .. = are dynamically scoped. So for  
example

FOR I% = 1 TO 10 : IF I% MOD 2 THEN PRINT "Odd" : NEXT : ELSE PRINT  
"Even" : NEXT

is quite legal (if unwise).

-- 
Andy Armstrong, hexten.net



More information about the london.pm mailing list