DoerParserclass | doer.t[827]

A DoerParser is a helper object we use during initialization for parsing Doer 'cmd' strings and turning them into action description lists. The language-specific library creates these for us based on the language grammar.

These objects are only used during initialization, since they're only needed to set up the internal representation of a Doer command template string. During normal play we only need that internal representation.

`class DoerParser : object`

Superclass Tree (in declaration order)

`DoerParser`
`object`

Subclass Tree

(none)

Global Objects

(none)

Summary of Properties

`action_ pat_ roles_ verb_`

Summary of Methods

`construct`

Properties

`action_` | `doer.t[842]`

The Action object for the verb.

`pat_` | `doer.t[862]`

The regular expression for the verb rule. The verb initializer sets this up to contain the literal text of the verb rule's literal tokens, and to substitute a parenthesized group wildcard pattern for each noun slot. For example, for English, a Give To rule might look like 'give (.+) to (.+)'.

`roles_` | `doer.t[871]`

The list of object roles. This is a list of NounRole objects. The list entries correspond positionally to the parenthesized groups in the regular expression string, so roles_[1] is the noun role for the first parenthesized group, roles_[2] is the noun role for the second group, and so on.

`verb_` | `doer.t[853]`

The main verb word. This is simply the first word of the verb's token list. This is essentially a hash, to reduce the number of regular expressions we have to test individually. This saves us a lot of compute time, since it's very quick to pull out the first word and get a list of the small set of rules with the same first word. We then test each of those potential matches by doing the full regular expression comparison.

Methods

`construct (action, v, pat, roles)` | `doer.t[833]`

Construction. The language library should create one of these objects for each verb phrasing it wants to define for use in writing Doer 'cmd' strings.

Adv3Lite Library Reference Manual
Generated on 12/09/2014 from adv3Lite version 1.4