[MUD-Dev] Parser engines

Sean Middleditch elanthis at awesomeplay.com
Thu Mar 11 09:49:20 CET 2004


On Wed, 2004-03-10 at 07:26, ext.Christer.Enfors at tietoenator.com wrote:
> From: Brian Hook [mailto:brianhook at pyrogon.com]

>> I've been looking at the various input parsers in different MUDs
>> (although I haven't had a chance to look at commercial text
>> MUDs), and by and large the parser technology seems to be roughly
>> early-Infocom, if that.

> Have you looked at the "natural language parser" used by MudOS
> (LPMud driver) and Lima (mudlib)? It's the best one I've seen so
> far. IIRC, it's able to handle things such as:

>   > look at the first orc's second shiny sword

> It also makes it easy to create "verbs". For each verb, you can
> add a set of rules that the parser matches against the input, to
> see if the input is correct. For example, the rules for the
> "search" verb are as follows:

This all sounds fairly similar to AweMUD's handler.  The code isn't
quite as modularized as this, but close.  Commands (verbs) are
specified as a format string, and the functions for looking up
objects/characters/etc handle quite a few things such as "my sword"
vs "the sword" and "fourth orc" vs "other orc" and all that.  Code
is all BSD licensed and in C++, if that's what you need for your
project.

An example command that works is: "get the third sword from in my
backpack" Plus short-cutting is in throughout the code, so the above
could also be written as "get #3 sw fr in my ba".  The "my" keyword
is fairly important in some situation, it ensures that only objects
on your person are searched, so a command like "put sw in back"
won't accidently put it in a backpack on the ground or anything like
that.

--
Sean Middleditch <elanthis at awesomeplay.com>
AwesomePlay Productions, Inc.
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list