[MUD-Dev] World-file parsing and RTTI?

The Arrow arrow at trelleborg.mail.telia.com
Wed Feb 10 19:45:15 CET 1999


For my MUD, I have a simple yet pretty good (IMHO :) format for world-files.
A file contains one or more objects (monsters, locations, etc.), and each
object have a list of properties (key-value pairs).  Right now I have a
simple lexer in flex that search for certain keywords like "monster",
"location", "item".  When the parser finds such a keyword I create a new
instance of that specific C++ class.
My goal for the parser is to make it as flexible as possible, all anyone
using my code should have to do, is to add a line to a table.
Now comes the question:  What is the best way to do this?  I have though
about using RTTI, but to my knowledge there exists no platform/compiler
independant system.  I could limit the MUD to just be compileable with gcc
or egcs, but I don't like limiting myself in any way.
Discussion?

/ Joachim
======================================================================
The Arrow                   Email: arrow at trelleborg.mail.telia.com
Joachim Pileborg              WWW: http://w1.410.telia.com/~u41003102/
======================================================================
"They say I don't give a shit about anything," -- Magnus Uggla
"but I don't give a shit about that."        (translated from swedish)






More information about the mud-dev-archive mailing list