Next: , Previous: LanguageStrings Methods, Up: Core Methods



5.1.6 Parser Methods

— Method on Parser: start storageRef modules outputPort serverStop player languageStringsObjectRef

Starts a new parser objcet. outputPort is the Socket object that is used for sending output to the player. player is an object reference to the player object.

— Method on Parser: parseOutVerb string result

Just extracts the first word from the input string, which is then treated as the verb word.

— Method on Parser: parse input

First tests to see if the first character, by itself, is a verb, using matchVerbs, then tries the whole first word, again using matchVerbs. If that fails, complains to the character.

— Method on Parser: runVerb verb rest result

Attempts to match the input verb against any verb it can get its hands on, starting with the player object, then the player's contents, then the player's room, then everybody in the room.

This method does not implement the verb record parsing strategy; it calls verbParseRest for that.

verb contains the verb word, rest contains the rest of the input, and matched is set to true if a match was found.

— Method on Parser: verbParseRest verbParse rest verbMethod language result

Implements parsing of verb records. Takes the parse segment of a verb record, and returns a record named after the verb word with the various arg1:, arg2: ... elements in it, filled according to the parse record.

verbParse
The parse record for the verb.
language
The language of the verb match we're working against.
result
The results of the parse, as a record named after the verb word with features named according to the parse record.

— Method on Parser: eval input

Evaluates the input as a piece of Oz code. 1


Footnotes

[1] Currently isn't implemented as a verb; this needs to be fixed.