BasicPossessiveProd class | parser.t[2770]

Basic possessive phrase. The grammar rules for these phrases must map the possessive qualifier phrase to poss_, and the noun phrase being qualified to np_. We are based on DefiniteNounProd because we resolve the possessive qualifier as though it had a definite article.

The possessive production object poss_ must define the method getOrigMainText() to return the text of its noun phrase in a format suitable for disambiguation prompts or error messages. In English, for example, this means that the getOrigMainText() must omit the apostrophe-S suffix if present.

`class BasicPossessiveProd : DefiniteNounProd`

Superclass Tree (in declaration order)

`BasicPossessiveProd`
`DefiniteNounProd`
`NounPhraseProd`
`BasicProd`
`object`
`AmbigResponseKeeper`
`object`

Subclass Tree

`BasicPossessiveProd`
`ButPossessiveProd`
`exceptNounPhrase(singlePossessive)`
`DisambigPossessiveProd`
`disambigListItem(possessive)`
`PossessiveNounProd`
`qualifiedSingularNounPhrase(possessive)`
`PossessivePluralProd`
`explicitDetPluralNounPhrase(possessive)`
`explicitDetPluralOnlyNounPhrase(possessive)`

Global Objects

(none)

Summary of Properties

`npKeeper`

``

Inherited from `NounPhraseProd` :
`filterForCollectives`

Inherited from `BasicProd` :
`firstTokenIndex isSpecialResponseMatch lastTokenIndex`

Inherited from `AmbigResponseKeeper` :
`ambigResponses_`

Summary of Methods

`construct resolvePossessive selectWithPossessive`

Inherited from `DefiniteNounProd` :
`reduceDefinite resolveDefinite resolveNouns`

Inherited from `NounPhraseProd` :
`filterTruncations getVerifyKeepers`

Inherited from `BasicProd` :
`canResolveTo getOrigText getOrigTokenList setOrigTokenList`

Inherited from `AmbigResponseKeeper` :
`addAmbigResponse getAmbigResponses`

Properties

`npKeeper` | `parser.t[2979]`

our ambiguous response keeper

Methods

`construct ( )` | `parser.t[2779]`

To allow this class to be mixed with other classes that have mixed-in ambiguous response keepers, create a separate object to hold our ambiguous response keeper for the possessive phrase. We will never use our own ambiguous response keeper properties, so those are available to any other production class we're mixed into.

`resolvePossessive (resolver, results, num)` | `parser.t[2795]`

Resolve the possessive, and perform preliminary resolution of the qualified noun phrase. We find the owner object and reduce the resolved objects for the qualified phrase to those owned by the owner.

If we fail, we return nil. Otherwise, we return a list of the tentatively resolved objects. The caller can further resolve this list as needed.

`selectWithPossessive (resolver, results, lst, lstOrigText, num)` | `parser.t[2830]`

Resolve the possessive, and reduce the given match list by selecting only those items owned by the resolution of the possessive phrase.

'num' is the number of objects we want to select. If the noun phrase being qualified is singular, this will be 1; if it's plural, this will be nil, to indicate that there's no specific target quantity; if the phrase is something like "bob's five books," the the number will be the qualifying quantity (5, in this case).

TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3