Message expansion sentence context. This keeps track of the parts of the sentence we've seen so far in the substitution parameters.
The sentence context is important for expanding certain items. For verbs, it tells us which object is the subject, so that we can generate the agreeing conjugation of the verb (in number and grammatical person). For direct and indirect objects, it lets us generate a reflexive when the same object appears in a second role ("You can't put the box in itself").
class
MessageCtx : object
Superclass Tree (in declaration order)
MessageCtx
object
Subclass Tree
(none)
Global Objects
(none)
Summary of Properties
args
cmd
gotVerb
lastParam
prescan
reflexiveAnte
subj
vobj
Summary of Methods
actorIsPC
construct
endPreScan
lastParamPlural
noteObj
noteParam
noteVerb
paramToNum
paramToString
startSentence
Properties
the message argument list
the Command object among the arguments, if any
have we seen a verb parameter in this sentence yet?
are we on the initial pre-expansion scan?
The reflexive antecedents. Each time we see an object in a non-subject role, and the object has different pronoun usage from any previous entry, we'll add it to this list. If we see the same object subsequently in another non-subject role, we'll know that we should generate a reflexive pronoun for the object rather than the name or a regular pronoun:
You can't put the tongs in the box with the tongs -> with themselves
the subject of the sentence (as a Mentionable object)
the last object of the verb we saw
Methods
Is the actor involved in the Command the PC? If there's a Command with an actor, we check to see if it's the PC. If there's no Command or no actor, we assume that the PC is the relevant actor (since there's nothing else specified anywhere) and return true.
End the pre-expansion scan. The expander makes two passes over each sentence. The first scan doesn't actually do any substitutions, but merely invokes each parameter to give it a chance to exert its side effects on the sentence context. The second scan actually applies the substitutions. At the end of the first pass, the expander calls this to let us finalize the initial scan and prepare for the second scan.
Was the last parameter value plural? If the value is numeric, 1 is singular and anything else is plural. If it's a list, a one-element list is singular and anything else is plural. If it's a Mentionable, the 'plural' property determines it.
Note an object being used as a parameter in the given sentence role. The role is one of the noun role enums defined above: vSubject, vObject, or vAmbig. If the object is a subject, we'll save it as the sentence subject, so that we can generate an agreeing verb. Regardless of role, we'll also save it as a reflexive antecedent, so that we can generate a reflexive pronoun if we see the same object again in another role in the same sentence.
Note a parameter value. Some parameters refer back to the immediately preceding parameter, so it's useful to have the most recent value stashed away. Returns the parameter value as given.
Convert a parameter value to a numeric representation. If the value is an integer or BigNumber, we return it as is; if a list or vector, we return the number of elements; if nil, 0; if a string, the parsed numeric value of the string; otherwise we simply return 1.
Convert a parameter value to a string representation suitable for message substitution.
Adv3Lite Library Reference Manual
Generated on 03/07/2024 from adv3Lite version 2.1