Re: [LIST] Proposal to Increase Traffic

From: James Turner (turnerjh@XTN.NET)
Date: 04/29/98


Chris Jacobson <fear@ATHENET.NET> writes:

> Anyone besides myself interested in seeing the limit upped to 75 or so?

I know the limit has been hit a few times, but posts continued
through a little while later.  Quite useful when waging a holy war ;)

Now, the 200 line limit is a problem too... any chance of moving that
to 250?  (Quite annoying for a post to end up 210 lines)

> ObCircle:
> George, thanks for the mention of BIND, I'm looking at it now... I'll go
> C-style all the way, and hopefully I'll even release a patch (of sorts -
> in my usual, non-stock style :-)

What I'd really like to see is a very expandable, easily maintained
tagged parser.  The format you suggested before is good, but the only
down side (from a very hasty glance) was slightly non-uniform handling
of some parameters.  How about something like this:

struct objfile_entry_parser {
  const char *tag;
  enum of_entry_enum id; /* for integers, strings, multiline strings, etc */
  int offset;
  int (*parse) (void *); /* called on data */
};

Then you could have something like

struct objfile_entry_parser entry_parser[] = {
  ...
  {"vnum", OF_INTEGER, offsetof(obj_data, vnum), def_intparse},
  ...
};

Then adding new entries is mostly a matter of adding one line to the
structure (and perhaps a function if the format isn't one already
used).  Also perhaps add a field for mandantory entries and so forth.

This is similar to what envy does with pfiles.  I've not looked at
their worldfile handling.

A parser for this kind of file would be quite easy.  I've written a
parser for a c-like scripting language that hopefully I'll replace the
default deathgate scripts with.  Right now, it works acceptably well,
though is standalone.  It uses a syntax very similar to C (perhaps
more similar to perl).  One of the major features I like about it is
that it allows for separate, callable functions, which allows for a
scripting library.  As-is though, it's in very rough shape.  I'm
trying to make it as universal as possible and plan on GPLing it
(though how many people will find it useful I don't know).  Basically,
it's a mini-Guile with C syntax.  Small, but fairly fast and
efficient.  I like how it has progressed, but I've not had enough time
to work on it as much as I would like.

If it would be useful, I can let you have a copy of the lexical
analyzer part (probably the only useful part for your needs).
Basically it turns the input stream into a stream of tokens.  As it
stands, I'm using some code from glib since at the time it was much
easier than coding lists and hashes on my own (might need to redo it
sometime, but I'm too damn lazy when it works).

--
James Turner               turnerjh@xtn.net
                           http://www.vuse.vanderbilt.edu/~turnerjh/


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST