grammar.tfile | source file

------------------------------------------------------------------------

Summary of Classes

`aboutTopicPhrase(main) actorBadCommandPhrase(main) atSingleNoun(main) commandOnlyConjunction(nonSentenceEnding) commandOnlyConjunction(sentenceEnding) commandOrNounConjunction(main) commandPhrase(ambiguousConj) commandPhrase(definiteConj) completeNounPhrase(main) completeNounPhrase(miscPrep) completeNounPhraseWithAll(main) completeNounPhraseWithoutAll(main) compoundNounArticle(main) compoundNounPhrase(of) compoundNounPhrase(simple) compoundNounPrep(main) compoundPluralPhrase(of) compoundPluralPhrase(simple) contentsPrep(main) contentsPrepOrVerb(main) defaultCommandPhrase(examine) defaultVerbPhrase(noun) detPluralNounPhrase(main) detPluralOnlyNounPhrase(main) DirectionName directionName(root) disambigList(list) disambigList(single) disambigListItem(noun) disambigListItem(ordinal) disambigListItem(plural) disambigListItem(possessive) disambigOrdinalItem(main) disambigOrdinalList(head) disambigOrdinalList(tail) disambigPhrase(all) disambigPhrase(any) disambigPhrase(both) disambigPhrase(list) disambigPhrase(locational) disambigPhrase(ordinalList) EnTravelVia exceptList(main) exceptListBody(list) exceptListBody(single) exceptNounPhrase(singleComplete) exceptNounPhrase(singlePossessive) explicitDetPluralNounPhrase(definite) explicitDetPluralNounPhrase(definiteNumber) explicitDetPluralNounPhrase(possessive) explicitDetPluralNounPhrase(possessiveNumber) explicitDetPluralNounPhrase(possessiveNumber2) explicitDetPluralOnlyNounPhrase(definite) explicitDetPluralOnlyNounPhrase(definiteNumber) explicitDetPluralOnlyNounPhrase(possessive) explicitDetPluralOnlyNounPhrase(possessiveNumber) explicitDetPluralOnlyNounPhrase(possessiveNumber2) firstCommandPhrase(askTellActorTo) firstCommandPhrase(commandOnly) firstCommandPhrase(withActor) forSingleNoun(main) fromSingleNoun(main) implicitDetPluralOnlyNounPhrase(main) indetPluralNounPhrase(basic) indetPluralNounPhrase(locational) indetPluralOnlyNounPhrase(basic) indetPluralOnlyNounPhrase(locational) indetSingularNounPhrase(basic) indetSingularNounPhrase(locational) inSingleNoun(main) literalNounPhrase(number) literalNounPhrase(string) literalPhrase(empty) literalPhrase(miscList) literalPhrase(string) locationPrep(from) locationPrep(in) locationPrep(on) mainDisambigPhrase(main) miscWordList(list) miscWordList(wordOrNumber) nonTerminalNounMultiList(multi) nonTerminalNounMultiList(pair) nounConjunction(main) nounList(empty) nounList(list) nounList(nonTerminal) nounList(terminal) nounMultiList(multi) nounMultiList(nonterminal) nounPhrase(main) nounPhraseWithContents(basic) nounPhraseWithContents(contents) nounWord(noun) nounWord(nounAbbr) nounWord(nounApostS) numberObjPhrase(main) numberPhrase(digits) numberPhrase(spelled) onSingleNoun(main) oopsCommand(main) oopsPhrase(main) outOfSingleNoun(main) pluralPhrase(main) pluralPhraseWithContents(basic) pluralPhraseWithContents(contents) possessiveAdjPhrase(definiteNpApostropheS) possessiveAdjPhrase(her) possessiveAdjPhrase(his) possessiveAdjPhrase(indefiniteNpApostropheS) possessiveAdjPhrase(its) possessiveAdjPhrase(my) possessiveAdjPhrase(npApostropheS) possessiveAdjPhrase(their) possessiveAdjPhrase(your) possessiveNounPhrase(hers) possessiveNounPhrase(his) possessiveNounPhrase(its) possessiveNounPhrase(mine) possessiveNounPhrase(npApostropheS) possessiveNounPhrase(theirs) possessiveNounPhrase(yours) poundNumberPhrase(main) pronounPhrase(her) pronounPhrase(herself) pronounPhrase(him) pronounPhrase(himself) pronounPhrase(it) pronounPhrase(itself) pronounPhrase(me) pronounPhrase(them) pronounPhrase(themselves) pronounPhrase(us) pronounPhrase(you) putPrep(main) putPrepSingleNoun(main) qualifiedNounPhrase(main) qualifiedPluralNounPhrase(all) qualifiedPluralNounPhrase(allNum) qualifiedPluralNounPhrase(anyNum) qualifiedPluralNounPhrase(both) qualifiedPluralNounPhrase(definiteNum) qualifiedPluralNounPhrase(determiner) qualifiedPluralNounPhrase(theOnesContaining) qualifiedPluralNounPhrase(theOnesIn) qualifiedSingularNounPhrase(anyOneIn) qualifiedSingularNounPhrase(anyPlural) qualifiedSingularNounPhrase(arbitrary) qualifiedSingularNounPhrase(definite) qualifiedSingularNounPhrase(indefinite) qualifiedSingularNounPhrase(possessive) qualifiedSingularNounPhrase(theOneContaining) qualifiedSingularNounPhrase(theOneIn) quotedStringPhrase(main) simpleNounPhrase(adjAndOne) simpleNounPhrase(adjAndOnes) simpleNounPhrase(empty) simpleNounPhrase(list) simpleNounPhrase(literal) simpleNounPhrase(literalAndList) simpleNounPhrase(misc) simpleNounPhrase(noun) simplePluralPhrase(adjAndOnes) simplePluralPhrase(empty) simplePluralPhrase(misc) simplePluralPhrase(plural) singleNoun(empty) singleNoun(multiple) singleNoun(normal) singleNounOnly(main) spelledHundred(aHundred) spelledHundred(aHundredPlus) spelledHundred(hundreds) spelledHundred(hundredsPlus) spelledHundred(small) spelledMillion(aMillion) spelledMillion(aMillionAndSmall) spelledMillion(millions) spelledMillion(millionsAndSmall) spelledMillion(millionsPlus) spelledNumber(main) spelledSmallNumber(digit) spelledSmallNumber(teen) spelledSmallNumber(tens) spelledSmallNumber(tensAndUnits) spelledSmallNumber(zero) spelledThousand(aThousand) spelledThousand(aThousandAndSmall) spelledThousand(thousands) spelledThousand(thousandsAndSmall) spelledThousand(thousandsPlus) terminalNounPhrase(allBut) terminalNounPhrase(anyBut) terminalNounPhrase(pluralExcept) throughSingleNoun(main) topicPhrase(main) topicPhrase(misc) toSingleNoun(main) VerbRule(About) VerbRule(Again) VerbRule(AskAbout) VerbRule(AskAboutImplicit) VerbRule(AskAboutWhat) VerbRule(AskFor) VerbRule(AskForImplicit) VerbRule(AskVague) VerbRule(AskWhomFor) VerbRule(Attach) VerbRule(AttachTo) VerbRule(Attack) VerbRule(AttackWith) VerbRule(AuxQuery) VerbRule(Board) VerbRule(Break) VerbRule(Brief) VerbRule(Burn) VerbRule(BurnWith) VerbRule(Clean) VerbRule(CleanWith) VerbRule(Climb) VerbRule(ClimbDown) VerbRule(ClimbDownWhat) VerbRule(ClimbUp) VerbRule(ClimbUpWhat) VerbRule(Close) VerbRule(ConsultAbout) VerbRule(ConsultWhatAbout) VerbRule(Continue) VerbRule(Credits) VerbRule(Cut) VerbRule(CutWith) VerbRule(Detach) VerbRule(DetachFrom) VerbRule(Dig) VerbRule(DigWith) VerbRule(Doff) VerbRule(Drink) VerbRule(Drop) VerbRule(Eat) VerbRule(Enter) VerbRule(EnterOn) VerbRule(Evaluate) VerbRule(Examine) VerbRule(Exits) VerbRule(ExitsColour) VerbRule(ExitsMode) VerbRule(Extinguish) VerbRule(ExtraHints) VerbRule(Fasten) VerbRule(FastenTo) VerbRule(Feel) VerbRule(FiatLux) VerbRule(Flip) VerbRule(Follow) VerbRule(FullScore) VerbRule(GetOff) VerbRule(GetOut) VerbRule(GetOutOf) VerbRule(GiveTo) VerbRule(GiveToImplicit) VerbRule(GiveToType2) VerbRule(GoAlong) VerbRule(GoBack) VerbRule(GoNear) VerbRule(Goodbye) VerbRule(GoThrough) VerbRule(GoTo) VerbRule(Hello) VerbRule(Hints) VerbRule(HintsOff) VerbRule(In) VerbRule(Inventory) VerbRule(InventoryTall) VerbRule(InventoryWide) VerbRule(Jump) VerbRule(JumpOff) VerbRule(JumpOffIntransitive) VerbRule(JumpOver) VerbRule(Kiss) VerbRule(Lie) VerbRule(LieIn) VerbRule(LieOn) VerbRule(Light) VerbRule(Listen) VerbRule(ListenTo) VerbRule(Lock) VerbRule(LockWith) VerbRule(Look) VerbRule(LookBehind) VerbRule(LookIn) VerbRule(LookThrough) VerbRule(LookUnder) VerbRule(LookUp) VerbRule(LookX) VerbRule(Move) VerbRule(MoveTo) VerbRule(MoveWith) VerbRule(No) VerbRule(Notify) VerbRule(NotifyOff) VerbRule(NotifyOn) VerbRule(Open) VerbRule(Out) VerbRule(PlugIn) VerbRule(PlugInto) VerbRule(PlugIntoWhat) VerbRule(Pour) VerbRule(PourInto) VerbRule(PourOnto) VerbRule(Pull) VerbRule(Purloin) VerbRule(Push) VerbRule(PushTravelClimbDown) VerbRule(PushTravelClimbUp) VerbRule(PushTravelDir) VerbRule(PushTravelEnter) VerbRule(PushTravelGetOutOf) VerbRule(PushTravelThrough) VerbRule(PutBehind) VerbRule(PutIn) VerbRule(PutOn) VerbRule(PutUnder) VerbRule(PutWhere) VerbRule(Query) VerbRule(Query2) VerbRule(QueryAbout) VerbRule(QueryVague) VerbRule(Quit) VerbRule(Read) VerbRule(Record) VerbRule(RecordEvents) VerbRule(RecordEventsString) VerbRule(RecordOff) VerbRule(RecordString) VerbRule(Remove) VerbRule(ReplayQuiet) VerbRule(ReplayString) VerbRule(Restart) VerbRule(Restore) VerbRule(RestoreString) VerbRule(Save) VerbRule(SaveString) VerbRule(Say) VerbRule(SayTo) VerbRule(Score) VerbRule(Screw) VerbRule(ScrewWith) VerbRule(ScriptOff) VerbRule(ScriptOn) VerbRule(ScriptString) VerbRule(Search) VerbRule(Set) VerbRule(SetTo) VerbRule(ShowTo) VerbRule(ShowToImplicit) VerbRule(ShowToType2) VerbRule(Sit) VerbRule(SitIn) VerbRule(SitOn) VerbRule(Sleep) VerbRule(Smell) VerbRule(SmellSomething) VerbRule(Stand) VerbRule(StandIn) VerbRule(StandOn) VerbRule(Strike) VerbRule(Switch) VerbRule(SwitchOff) VerbRule(SwitchOn) VerbRule(Take) VerbRule(TakeFrom) VerbRule(TalkAbout) VerbRule(TalkAboutImplicit) VerbRule(TalkTo) VerbRule(Taste) VerbRule(TellAbout) VerbRule(TellAboutImplicit) VerbRule(TellAboutWhat) VerbRule(TellThat) VerbRule(TellTo) VerbRule(TellVague) VerbRule(Think) VerbRule(ThinkAbout) VerbRule(Throw) VerbRule(ThrowAt) VerbRule(ThrowDir) VerbRule(ThrowDirDown) VerbRule(ThrowTo) VerbRule(ThrowToType2) VerbRule(Topics) VerbRule(Travel) VerbRule(Turn) VerbRule(TurnTo) VerbRule(TurnWith) VerbRule(TypeLiteralOn) VerbRule(TypeLiteralOnWhat) VerbRule(TypeOn) VerbRule(Undo) VerbRule(Unfasten) VerbRule(UnfastenFrom) VerbRule(Unlock) VerbRule(UnlockWith) VerbRule(Unplug) VerbRule(UnplugFrom) VerbRule(Unscrew) VerbRule(UnscrewWith) VerbRule(VagueTravel) VerbRule(Verbose) VerbRule(Version) VerbRule(Wait) VerbRule(Wear) VerbRule(Write) VerbRule(WriteOn) VerbRule(Yell) VerbRule(Yes) withSingleNoun(main) yesOrNoPhrase(no) yesOrNoPhrase(yes)`

Summary of Global Objects

`evalPreParser queryPreParser`

Summary of Global Functions

`DefineLangDir initDoerParsers stripQuotesFrom`

Global Functions

`DefineLangDir (north, ', north, ', |, ', n, ', ', back, to, the, ', ', to, the, north, ')` | `grammar.t[1375]`

no description available

`initDoerParsers (ptab)` | `grammar.t[3582]`

Initialize the DoerParser table. This populates the given DoerParserTable with DoerParser objects that describe the syntax available for use in Doer 'cmd' strings.

Each DoerParser object simply provides a regular expression for parsing one action phrasing. The regular expression defines the language-specific template for the action phrasing, with the proviso that each noun phrase is replaced with an object or class name, or a list of object or class names separated with '|' characters.

For example, for a Give To command in English, we might define one DoerParser for each of the following regular expressions:

'give (<alphanum|_|vbar>+) to (<alphanum|_|vbar>+)'
'give (<alphanum|_|vbar>+) (<alphanum|_|vbar>+)'

After you create a DoerParser, simply call ptab.addParser() to add the new parser to the table.

Note that, regardless of the language, you MUST use a verb syntax that starts with a verb word, because of the way the parser lookup table is built. Most languages naturally start an imperative with a verb anyway, so this is usually what you'd do even without this requirement. For a language that uses another word order for imperatives, though, you'll have to use an unnatural syntax for the DoerParser syntax, and thus for the Doer 'cmd' string syntax. This unnatural syntax is purely internal to the library and games, though - players won't see it.

It's up to the language module to determine how to come up with the list of verb phrases, and how to build the verb regular expression patterns. The English library builds the list directly from the player command grammar - specifically, the syntax token lists defined for the VerbRule productions.

This English implementation also takes the opportunity to build grammar templates for each Action. This is purely for our own use in the English library, so other languages don't have to replicate that functionality. We do this here because we build these from the same information that we use to build the DoerParsers.

[Required]

`stripQuotesFrom (str)` | `grammar.t[893]`

Service routine: strip quotes from a *possibly* quoted string. If the string starts with a quote, we'll remove the open quote. If it starts with a quote and it ends with a corresponding close quote, we'll remove that as well.

Adv3Lite Library Reference Manual
Generated on 12/12/2022 from adv3Lite version 1.6