Re: [GD-General] Text file parsing
Brought to you by:
vexxed72
|
From: Tom S. <to...@pi...> - 2002-12-11 17:16:19
|
> If you're starting fresh, I would recommend using XML for structured text
> files. You can use TinyXML to read them (use google to locate it).
Also take a look at CMarkup ( http://www.firstobject.com/ ). IMO it's
easier to use than all the other XML parsers i've tried... even ones in Java
and C#. Tom
----- Original Message -----
From: "Javier Arevalo" <ja...@py...>
To: <gam...@li...>
Sent: Wednesday, December 11, 2002 5:16 AM
Subject: Re: [GD-General] Text file parsing
> We use a structure very similar to ASE for our data definition files.
> Writing the parser for it was about a couple hours.
>
> If you're starting fresh, I would recommend using XML for structured text
> files. You can use TinyXML to read them (use google to locate it).
>
> Marc Fascia <mf...@pu...> wrote:
> > Hello,
> >
> > I'm currently writing a toolkit that will be used as a basis for my
> > next game engine. It will feature one or several editing tools for
> > content creation, as one of the objective is to be data-driven. In
> > the process, I plan to use some intermediate text-based file formats,
> > such as ASE for meshes (easy to export from any modelling packages),
> > text shaders/material files and so on.
> >
> > My question is about the best way of writing file-parsers for these
> > files. I can see currently 2 options
> >
> > 1) use some tools like Lex&Yacc
> > - Pros : easy to use, fast development time, easy to make the grammar
> > evolve
> > - Cons : for now, I was unable to make Lex&Yacc create some nice C++
> > parser class that can be embedded in my tools.
> >
> > 2) write my own from scratch, maybe first writing a DumbParser class
> > that just provides with a bunch of basic string function, acting like
> > a Lexer and derive the different needed parsers from that, embedding
> > the grammar inside
> > - Pros : full control on the design and the implementation, in
> > comparison to the obfuscated code from Ley/Yacc
> > - Cons : more development time, grammar kind of hardcoded so not
> > easily maintainable, I'm not very experienced in writing text parsers
> > :)
> >
> > I wonder how people handle file parsing in their projects.
> > Thanks for your help.
> >
> > -Marc
>
>
> Javier Arevalo
> Pyro Studios
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:
> With Great Power, Comes Great Responsibility
> Learn to use your power at OSDN's High Performance Computing Channel
> http://hpc.devchannel.org/
> _______________________________________________
> Gamedevlists-general mailing list
> Gam...@li...
> https://lists.sourceforge.net/lists/listinfo/gamedevlists-general
> Archives:
> http://sourceforge.net/mailarchive/forum.php?forum_id=557
>
|