Original Parser

version 1 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Pronoun Handling

    [To reset vague words with (obj - an object) (this is ResetVagueWords): set pronouns from the obj.]

    To change (pronoun - an understood word) to (obj - an object) (this is SetPronoun):
        if the pronoun is listed as one of the pronouns in the language's pronoun list:
            change the chosen antecedent element to the obj;
            stop;
        issue the 14th run-time message "** Library error 14 (0,0) **[line break]** (unexplained) **[line break]".

    [ SetPronoun dword value x;
    for (x=1 : x<=LanguagePronouns-->0 : x=x+3)
    if (LanguagePronouns-->x == dword) {
    LanguagePronouns-->(x+2) = value; return;
    }
    RunTimeError(14);
    ]

    [ Returns 'nothing' if the inputted word isn't one of the four pronouns. Returns the 'used-up object' (NULL) if it's an unset pronoun. ]
    To decide which object is what (pronoun - an understood word) stands for (this is PronounValue):
        if the pronoun is listed as one of the pronouns in the language's pronoun list:
            decide on the antecedent element.

    [ PronounValue dword x;
    for (x=1 : x<=LanguagePronouns-->0 : x=x+3)
    if (LanguagePronouns-->x == dword)
    return LanguagePronouns-->(x+2);
    return 0;
    ]

    To decide which word usage is the gender-animation usages for (obj - object):
        (- PowersOfTwo_TB-->(GetGNAOfObject({obj})) -).

    To set pronouns from (obj - an object) (this is PronounNotice):
        if the obj is the player, stop; [ even in 3rd person, the player wouldn't refer to his avatar as him/her. ]
        repeat through all three columns of the language's pronoun list:
            if the gender-animation element includes any of the gender-animation usages for the obj:
                change the chosen antecedent element to the obj.

    [ PronounNotice obj x bm;
    if (obj == player) return;

    bm = PowersOfTwo_TB-->(GetGNAOfObject(obj));

    for (x=1 : x<=LanguagePronouns-->0 : x=x+3)
    if (bm & (LanguagePronouns-->(x+1)) ~= 0)
    LanguagePronouns-->(x+2) = obj;
    ]