moo.core.parse

Parse command strings sent by the client.

This parser can understand a variety of phrases, but they are all represented by the (BNF?) form:

<verb>[[[<dobj spec> ]<direct-object> ]+[<prep> [<pobj spec> ]<object-of-the-preposition>]*]

There are a long list of prepositions supported, some of which are interchangeable.

Functions

interpret(ctx, line)

For a given user, execute a command.

split_command_fragments(line)

Split line into independent command fragments on ., ,, ;, and the standalone word THEN (case-insensitive).

unquote(s)

Classes

Lexer(command)

An instance of this class will identify the various parts of a imperative sentence.

Parser(lexer, caller)

The parser instance is created by the avatar.

Pattern()