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

Lee Hughes toxicnaan at yahoo.co.uk
Tue Feb 12 12:12:55 GMT 2008


does this help

http://xmlsoft.org/examples/index.html#parse1.c


storing configration data as xml files seems to be popular these days..

http://dinosaur.compilertools.net/yacc/index.html

yacc may help you?

I'd go with xml

http://expat.sourceforge.net/


may be interesting..

what exactly are you trying to do? and what tools do you have aviable on
the ps2.  if you just doing rough development, and depending on
the size of the config, you could just  pass stuff at the cmd line.

have a look at the icecast2 source code, that parses and xml file
and create a configuration, using that code you can probably have something
running quite quickly.


Barry Carr <barry at benericht.co.uk> wrote: 
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
> 

_______________________________________________
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


       
---------------------------------
 Support the World Aids Awareness campaign this month with Yahoo! for Good
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.lug.org.uk/pipermail/dundee/attachments/20080212/18d7e538/attachment.html


More information about the dundee mailing list