EmptyNounPhraseProdclass
An empty noun phrase production is one that matches, typically with non-zero badness value, as a placeholder when a command is missing a noun phrase where one is required.
Each grammar rule instance of this rule class must define the property ‘responseProd’ to be the production that should be used to parse any response to an interactive prompt for the missing object.
class
EmptyNounPhraseProd
:
NounPhraseProd
Superclass Tree (in declaration order)
EmptyNounPhraseProd
NounPhraseProd
BasicProd
` object`
Subclass Tree
EmptyNounPhraseProd
ImpliedActorNounPhraseProd
nounList(empty)
singleNoun(empty)
Global Objects
(none)
Summary of Properties
asker_
fallbackResponseProd
newMatch
responseProd
Inherited from NounPhraseProd
:
filterForCollectives
Inherited from BasicProd
:
firstTokenIndex
isSpecialResponseMatch
lastTokenIndex
Summary of Methods
getImpliedObject
getOrigText
getOrigTokenList
isEmptyPhrase
resolveNouns
setPrompt
Inherited from NounPhraseProd
:
filterTruncations
getVerifyKeepers
Inherited from BasicProd
:
canResolveTo
setOrigTokenList
Properties
asker_
The ResolveAsker we use to generate our prompt. Use the base ResolveAsker by default; this can be overridden when the prompt is to be customized.
fallbackResponseProd
Our fallback response production - if responseProd is nil, this must be supplied for cases where we can’t get the production from the action. This is ignored if responseProd is non-nil.
newMatch
the new match, when we get an interactive response to a query for the missing object
responseProd
Our “response” production - this is the production we use to parse the player’s input in response to our disambiguation prompt. A subclass can leave this as nil, in which case we’ll attempt to get the appropriate response production from the action.
Methods
getImpliedObject (resolver, results)
Get an implied object to automatically fill in for the missing noun phrase. By default, we simply ask the ‘results’ object for the missing object.
getOrigText ( )
OVERRIDDEN
Get my original text. If I have a new match tree, return the text from the new match tree. Otherwise, we have no original text, since we’re an empty phrase.
getOrigTokenList ( )
OVERRIDDEN
Get my tokens. If I have a new match tree, return the tokens from the new match tree. Otherwise, we don’t have any tokens, since we’re empty.
isEmptyPhrase ( )
I’m an empty noun phrase, unless I already have a new match object.
resolveNouns (resolver, results)
resolve the empty phrase
setPrompt (response, asker)
customize the way we generate the prompt and parse the response
TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3