external next up previous contents index
Next: Verb argument specification Up: 10.4 Verbs and command Previous: 10.4 Verbs and command

Command parsing

 

The MOO server will parse a command that is entered according to several principles. Here we will just look at the most important.

  1. It will replace some standard abbreviations (``'''', ``:'', ``;'') by corresponding verbs.
  2. Next the command line is split into ``items'', i.e. every string will become an item and every word (separated by spaces and other separators (??) NOT in an explicit string will become an item. gif
  3. Next the ``sentence'' made up by those items is broken into either verb, direct object, preposition, indirect object or verb, direct object

    1. The first item in the list is taken as the name of a verb
    2. Next, the server looks for a proposition (one out of the predefined set). Items between the verb and before the preposition is considered to represent the direct object and all items after the preposition are considered to represent the indirect object.
    3. If there was no preposition, everything that follows the first item (the verb) is considered to represent a direct object.

  4. Next, the server will try to find MOO objects that could match direct and indirect object. Several possible cases may exist:

  5. Finally, the server then tries to find the verb on each of the following objects:

    1. the player who typed to command
    2. the room the player is in
    3. the direct object (if it found one above)
    4. the indirect object (if it found one above)

      In order to match, all the following conditions must be true:

    1. the verb ``description'' found above matches one of the names for the verb on the object
    2. the direct and indirect object types are allowed by the corresponding argument specifiers for the verb
    3. the preposition string is matched

next up previous contents index external
Next: Verb argument specification Up: 10.4 Verbs and command Previous: 10.4 Verbs and command

Daniel K. Schneider
Thu Apr 17 12:43:52 MET DST 1997