Bison parser on MSX: ROM, sources and Howto

by andrear1979 on 19-05-2008, 00:53
Topic: Development

Andrea Rossetti from Italy wrote a brief tutorial on how to build a Bison parser for MSX using the SDCC cross-compiler; the resulting .ROM program can read an input sequence, do a syntax check and perform actions on specific subgroups of tokens.

Possible applications that may benefit of a Bison parser are (among others) textual adventure games, compilers, interpreters and loaders of formatted data for game levels. Tutorial, source code and an example ROM file are available at andrear's website.

Relevant link: andrear's website

Comments (4)

By pitpan

Prophet (3152)

pitpan's picture

19-05-2008, 08:22

Whow. Never expected to find Bison available for MSX! Bison (and Flex) are the core of asMSX. Is this an omen for an upcoming asMSX native MSX version? I doubt it, but it is cool to know that such possibility exists.

By andrear1979

Expert (97)

andrear1979's picture

19-05-2008, 09:35

I would remark that Bison parsers were immediately compilable on SDCC, without changes to the intermediate C file.

I think it should work as well with flex, but I wasn't able to reach the same results, the C source gives many errors with SDCC. My parser uses only Bison and a simple handmade tokenizer at the moment.

My next experiments might be devoted to try using Flex on MSX, I'll keep MRC informed about it.

Sincere regards, Andrea


Enlighted (6845)

ARTRAG's picture

21-05-2008, 16:24

Why not trying a more enjoying port ?

Do you know angband ? It is a nice D&D game with simple graphic (even in ASCII)

It's C sources are free and online.

look e.g. here

and it can fit for sure in a rom.


Enlighted (6845)

ARTRAG's picture

22-05-2008, 14:16