[Coco] C interpreter for Coco BASIC?

Lee Patterson lee at 8bitcoder.com
Sun Mar 12 00:35:33 EST 2017


Years back I found something called Small Basic. I just googled it again, and got some other hits that didn’t seem like the same thing. Wish I had kept track of where I originally got it from. I was able to update it to use labels instead of line numbers, and actually used it as a script interpreter for MUD I worked on. Pretty simple interpreter to use and modify. 

Very small, consisting of 2 files and a total of 877 lines:

     334 EXPARSE.C
     543 SBASIC.C
     877 total


Supported the following:

        "print",  PRINT,
        "input",  INPUT,
        "if",     IF,
        "then",   THEN,
        "else",   ELSE,
        "goto",   GOTO,
        "for",    FOR,
        "next",   NEXT,
        "to",     TO,
        "gosub",  GOSUB,
        "return", RETURN,
        "end",    END,


>From the source:


/**********************************************************/
/* SMALL BASIC Interpeter (sbasic.c) V0.2                 */
/* Copyright (C) 1994 James J. Bielman                    */
/* Adapted from _C Power User's Guide_ by Herbert Schildt */
/**********************************************************/

If you are interested, I can email the zip of it.

Lee


On 3/12/17, 12:14 AM, "Coco on behalf of RETRO Innovations" <coco-bounces at maltedmedia.com on behalf of go4retro at go4retro.com> wrote:

    Before I go roll my own interpreter for the Coco tokenized BASIC, anyone 
    know of an open source C implementation?
    
    Jim
    
    
    -- 
    RETRO Innovations, Contemporary Gear for Classic Systems
    www.go4retro.com
    store.go4retro.com
    
    
    -- 
    Coco mailing list
    Coco at maltedmedia.com
    https://pairlist5.pair.net/mailman/listinfo/coco
    




More information about the Coco mailing list