[MUD-Dev] Text Parsing
Ross Nicoll
rnicoll at lostics.demon.co.uk
Wed Jun 2 04:49:50 CEST 1999
On Tue, 1 Jun 1999, Chris Gray wrote:
> [Ross Nicoll:]
> > I've worked on text games in the Infocom format, and the parser is hardly
> > simple. About 280k of Inform code is used, just for the basic parser,
> <Blink!>
> ami-cg /home/cg/MUD/Src/MUDServ % wc match.c parse.c
> 989 3280 19010 match.c
> 1855 5948 40763 parse.c
> 2844 9228 59773 total
> Handles nearly as much as I've seen an Infocom parser do.
Sorry, I was counting the Inform parser code, which is byte compiled then
interpreted, and includes things like the definition of 99% of the verbs
in most games...
> > Wouldn't take much memory, but coding time would be very, very long
> > compared to a simple parser, and it would have a much higher CPU usage too
> > (although that may not make so much of a difference).
> <Blink Blink!>
> Why would it take a lot of CPU time? That all depends on the method you
> use. If you use an actual pattern matcher for each kind of sentence, or
> for each possible verb combination, then yes, that can take a lot of CPU.
> However, if you just pull off the verb, find the other parts of the
> command, and then process according to the verb's requirements, there is
> little CPU involved. Thinking about mine, its mostly linear in the number
> of words (or characters, pretty much the same thing) in the command. I've
> never even seen the parser show up in my profiling runs.
Oh dear, it's just me being me then, again. I'm still trying to learn
cope with the idea of things being slow if not coded in assembly :) Spent
too much time using 68000 and 68020 processors. Seriously though, I tend
to find it difficult to work out how much of a problem things will be on a
faster processor... my last MUD server ran just fine on a 68020, and the
only thing that had a noticable amount of CPU time used in it, was when it
wrote the 1mb database out to disk.
--
_ __ __ __
/_) / / (_ (__
/\ /_/ __) /
______________/
_______________________________________________
MUD-Dev maillist - MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list