RE: [GD-General] Text file parsing
Brought to you by:
vexxed72
From: Awen L. <ali...@ed...> - 2002-12-11 11:23:49
|
I warmly recommend the XML option as a text file. Very smart, even if you're using only its simplest functionnalitites (tag enclosure and hierarchy save you a lot of further format maintenance time). And maybe there are now some recommendations ready concerning Scene/Mesh 3D. If it could help you... Awen -----Message d'origine----- De : gam...@li... [mailto:gam...@li...]De la part de Javier Arevalo Envoyé : mercredi 11 décembre 2002 12:17 À : gam...@li... Objet : 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 |