[dundee] Parser howto... possibly including bisons so watch out!

Barry Carr barry at benericht.co.uk
Tue Feb 12 11:59:05 GMT 2008


Nistur wrote:
> Hey, I was just wandering whether anyone had any experience making 
> parsers. I am currently trying to make a PS2 game (using the PS2 Linux 
> Devkit) and want to start creating config files for various things 
> (maybe XML, maybe custom layout, yet to be decided) and have tried 
> looking into writing my own parser function. I can't seem to find 
> anything anywhere in the form of a guide or tutorial to give me 
> directions. Everywhere I look says Bison.
> I have tried looking for Bison tutorials and come up with very little too.
> Does anyone have any experience with Bison or even have any knowledge on 
> the writing of parsers?

Hi Nistur,

I'll admit I know absolutely nothing about Bison but it sounds a bit heavy-weight just to parse some 
config files. If you want to save config data as XML then get an XML lib do the work for you. Other 
than that, you can do a great deal by just reading the file and parsing the contents with regular 
expressions.

Another config format you might want to consider is JSON (JavaScript Object Notation). IMHO, is much 
easier to deal with than XML and directly executable by JavaScript (not that you'll want that, I 
suppose). You can get open-source JSON parsers for C++ (I'm assuming you're working with C++).

HTH

Cheers
Barry

> 
> Thanks
> Nistur
> 
> ------------------------------------------
> http://nistur.chaosnet.org
> 
> 
> _______________________________________________
> dundee GNU/Linux Users Group mailing list
> dundee at lists.lug.org.uk  http://dundee.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/dundee
> Chat on IRC, #tlug on dundee.lug.org.uk
> 



More information about the dundee mailing list