A-code command parsing

Sorry, this document is still under construction!

While all command examples in this document are given in the upper case for ease of visual identification, A-code parser is case-insensitive: all command are automatically forced into lower case.

A command consists of one or more words (a.k.a. tokens), delimited by blanks (spaces). All leading and trailing blanks are ignored and multiple blanks are treated as a single blank.

A single player command has the simple verb or verb/noun structure (but see below for some exceptions).

Compound commands can be constructed by joining single commands by commands delimeters. The parser recognises three delimeters, which are theated as comlpetely synonymous: a semicolon (;), a dot (.) or ' then ' (note that unlike the colon or the dot, the ' then ' delimeter must be surrounded by blanks, to make it into a separate token.

Individual command tokens are matched against the game's vocabulary. At game's dicretion, the matching process may be restricted to exact matches, or permit minimal (automatically derived) abbreviations, or permit single typo correction – see the vocabulary description for more details.

By default, in two word commands, the first command token is considered to be the verb and the second one as the noun, e.g. TAKE BOTTLE. However, if the first token is not likely to be a verb (being e.g. a place or an object) and the the second is identifiably a verb, the parser will automatically swap them around, making BOTTLE TAKE also a legitimate command.

Identifying words: all forced to lower case; automatic abbreviations and error correction (see the vocabulary document for details).

Basic command: "verb" or "verb noun".

The AGR1, ARG2 and STATUS variables and their values (including error values).

Default object (not IT!).

Description scanning for missing vovabulary words

Multiple commands per line: separators '.' (full stop), or ; (semicolon) or the word then.

Explicit object iteration: separators ',' (comma) or the word and.

Implicit object iteration: the DOALL directive.

The except syntax.

Uses of it.

The again (or repeat) verb. On is own and in a multiple command line.

Orphan handling (PLS.CLARIFY).

Attempted disambiguation.

Error handling.

Back to the A-code page

To the Mipmip home page
Feel free to leave a comment!
Mike Arnautov (04 August 2018)