Original Parser

version 1 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next



  • Section 2 - parser

    Where the comma was found is a number that varies.

    To parse (this is Parser__parse):
        now the ranking strategy is 0;
        reset the parser's results;
        now the action out of world is false;
        [ PARSER LETTER A ]
        if we have more to parse:
            we no longer have more to parse;
            Parse the player's input buffer into the player's parsed command;
        otherwise:
            (At this point we ReType);
            while this isn't done:
                now the ranking strategy is 0;
                now the actor's scopewise location is the scope ceiling of the player;
                begin THE READING A COMMAND ACTIVITY;
                if handling THE READING A COMMAND ACTIVITY:
                    let nw be the number of words typed in at the keyboard into the player's input buffer and the player's parsed command;
                    now the player's command is the empty snippet lengthened by the word count;
                    now the number of words in the command is the word count;
                end THE READING A COMMAND ACTIVITY; [ this one fails on "reject the player's command" ]
            do that again while the rule failed;
        (At this point we ReParse);
        bugfix now the current names list is the name list;
        now the number of words in the command is the word count;
        now the parser's current word position is 1;
        [consider the convert to subject–verb–object format rule; [ A hook for non-English player languages. ]]
        PARSE the player's input buffer into the player's parsed command;
        now the number of words in the command is the word count;
    [ k=0;]
        if trace 2, say the parsed command;
        now the verb's position is 1;
        now the person asked is the player;
        now the actor's scopewise location is the scope ceiling of the player;
        now the predicate's position is 0;
        (At this point we AlmostReParse);
        now the scope decider is the nothing rule;
        now the action to be is the default value of action names;
        now where the comma was found is 0;
        (At this point we BeginCommand);
        now the parser's current word position is the verb's position;
        now the verb is the next word if any;
        [ If there's no input here, we must have something like "person,". ]
        if the verb is no more words left to parse:
            now the best parser error so far is the didn't understand error;
            (go down to where we GiveError);
        [ Now try for "again" or "g", which are special cases: don't allow "again" if nothing
        ! has previously been typed; simply copy the previous text across ]
        if the verb is 'AGAIN':
            if the player is not the person asked:
                issue the 20th response "To repeat a command like ~frog, jump~, just say ~again~, not ~frog, again~.";
                (go back up to where we ReType);
            if the number of letters in the AGAIN input buffer is 0:
                issue the 21st response "You can hardly repeat that.";
                (go back up to where we ReType);
            copy the AGAIN input buffer into the player's input buffer;
            PARSE the player's input buffer into the player's parsed command;
            now the number of words in the command is the word count;
            now the player's command is the empty snippet lengthened by the word count;
            (go back up to where we ReParse);
        copy the player's input buffer into the AGAIN input buffer;
        if the predicate's position is 0 [unknown]:
            let the new verb be using normal grammar;
            if the hidden personalized grammar of the person asked is not currently blank:
                now the new verb is the personalized grammar of the person asked considered;
                if trace 2, say " [bracket]Grammar property returned [new verb as a debugging number][close bracket][line break]";
            if the new verb is this created action:
                change the parser's returned action to the action in progress;
                change the parser's returned noun to the noun;
                change the parser's returned second noun to the second noun;
                if the second noun is not nothing:
                    change the parser's returned parameter count to 2;
                otherwise if the noun is not nothing:
                    change the parser's returned parameter count to 1;
                otherwise:
                    change the parser's returned parameter count to 0;
                STOP;
            otherwise if the new verb is using normal grammar:
                now the parser's current word position is the verb's position;
                now the verb is the next word;
            otherwise:
                if the new verb would be an invalid understood word:
                    now the predicate's position is the verb's position;
                    now the new verb is the new verb without the tentatively;
                now the verb is the new verb as an understood word;
                decrement the parser's current word position;
                decrement the verb's position;
        otherwise:
            now the predicate's position is 0;
        [ Chapter - Parser Letter B ] [Is the command a direction name, and so an implicit GO? If so, go to (K).]
        [#Ifdef LanguageIsVerb;
        if (verb_word == 0) {
            i = wn; verb_word = LanguageIsVerb(buffer, parse, verb_wordnum);
            wn = i;
        }
        #Endif; ! LanguageIsVerb]
        [ If the first word is not listed as a verb, it must be a direction or the name of someone to talk to ]
        if the [first word] verb is a word unknown by the game or the usages of the verb does not include being a verb:
            [ So is the first word an object contained in the special object "compass"
            ! (i.e., a direction)? This needs use of NounDomain, a routine which
            ! does the object matching, returning the object number, or 0 if none found,
            ! or REPARSE_CODE if it has restructured the parse table so the whole parse
            ! must be begun again...]
            now the parser's current word position is the verb's position;
            now the indefinite article mode is false;
            now the noun filter is the nothing rule;
            now the number of parameters in the command is 0;
            save the person asked;
            save the action in progress;
            save the action to be;
            now the person asked is the player;
            now the action out of world is false;
            now the action in progress is the going action;
            now the action to be is the going action;
            let pu be the noun domain the compass and nothing under 'something';
            restore the action to be;
            restore the action in progress;
            restore the person asked;
            if pu is the misunderstood command:
                (go back up to where we ReParse);
            if pu is not noun domain's no match and pu as an object is a direction:
                change the parser's returned action to the going action;
                change the parser's returned noun to pu as an object; [line 100]
                change the parser's returned parameter count to 1;
                if any additional words present a problem:
                    (go down to where we GiveError);
                STOP;
        [ !Chapter - Parser Letter C ] [ Is anyone being addressed?]
        [ Only check for a comma (a "someone, do something" command) if we are
        ! not already in the middle of one. (This simplification stops us from
        ! worrying about "robot, wizard, you are an idiot", telling the robot to
        ! tell the wizard that he is an idiot.) ]
        if the player is the person asked:
            if where the comma was found is zero and the 'comma' is listed in the player's parsed command:
                now where the comma was found is where that word was found;
                [(At this point we have conversation);]
                if where that word was found is 1:
                    issue the 22nd response "You can’t begin with a comma.";
                    (go back up to where we ReType);
                [ Use NounDomain (in the context of "animate creature") to see if the words make sense as the name of someone held or nearby ]
                now the parser's current word position is 1;
                now the next token is 'something preferably held';
                now the reason for deciding scope is because we're parsing the addressee;
                let pu be the noun domain the player and the actor's scopewise location under 'someone';
                now the reason for deciding scope is because we're parsing the predicate nouns;
                if pu is the misunderstood command:
                    (go back up to where we ReParse);
                if pu is noun domain's no match:
                    if the verb is not a word unknown by the game and the usages of the verb includes being a verb:
                        (go down to where we do not have conversation);
                    otherwise:
                        issue the 23rd response "You seem to want to talk to someone, but I can’t see whom.";
                        (go back up to where we ReType);
                [(At this point we also have conversation);] [ The object addressed must at least be "talkable" if not actually "animate" (the distinction allows, for instance, a microphone to be spoken to, without the parser thinking that the microphone is human). ]
                unless pu as an object provides the property animate directly or pu as an object provides the property talkable directly:
                    issue the 24th response "You can’t talk to that.";
                    (go back up to where we ReType);
                [ Check that there aren't any mystery words between the end of the person's name and the comma (eg, throw out "dwarf sdfgsdgs, go north"). ]
                if the parser's current word position is not where the comma was found:
                    if the verb is not a word unknown by the game and the usages of the verb includes being a verb:
                        (Go down to where we do not have conversation);
                    otherwise:
                        issue the 25th response "To talk to someone, try ~someone, hello~ or some such.";
                        (go back up to where we ReType);
                [ Otherwise the player has now successfully named someone. Adjust "him", "her", "it": ]
                set pronouns from pu as an object;
                now the verb's position is where the comma was found + 1; [ i.e., right after the comma ]
                [ Stop things like "me, again": ]
                if pu as an object is the player:
                    now the parser's current word position is the verb's position;
                    if the next word if any is 'AGAIN':
                        issue the 20th response "To repeat a command like ~frog, jump~, just say ~again~, not ~frog, again~.";
                        (go back up to where we ReType);
                [ Set the global variable "actor", adjust the number of the first word, and begin parsing again from there. ]
                now the person asked is pu as an object;
                now the actor's scopewise location is the scope ceiling of the person asked;
                if trace 1, say "[bracket]Actor is [the person asked] in [the actor's scopewise location][close bracket][line break]";
                (go back up to where we BeginCommand);
        [ Chapter - Parser Letter D] [Get the verb: try all the syntax lines for that verb.]
        (At this point we do not have conversation);
        if the verb is a word unknown by the game or the usages of the verb does not include being a verb:
            if the person asked is the player:
                now the verb is the missing verb for noun-only commands;
            if the person asked is not the player or the verb is a word unknown by the game:
                now the best parser error so far is the not a verb I recognise error;
                (go down to where we GiveError); [ this will be converted to the Answering It About action for NPCs ]
        [.VerbAccepted;] [ We now definitely have a verb, not a direction, whether we got here by "take ..." or "person, take ..." ]
        now action out of world is whether or not (the usages of the verb include being out of world);
        if the action out of world is true and the person asked is not the player:
            [issue the 74th response "(That command asks to do something outside of play, so it can
    only make sense from you to me. [The person asked] cannot be asked to do this.)";]
            now the best parser error so far is the not a verb I recognise error;
            now action out of world is false;
            (go down to where we GiveError);
        if trace 1, say "[bracket]Parsing for the verb ['][verb]['][close bracket][line break]"; [ ([the number of grammar lines + 1] lines)]
        now the pronoun used is no more words left to parse;
        now the pronoun reference object is the used-up object;
        now the best parser error so far is the didn't understand error;
        now the second-best parser error so far is the didn't understand error;
        we shouldn't process the multiple object list;
        let allow multiple objects unconditionally be false;
        [ Chapter - Parser Letter E ] [Break down a syntax line into analysed tokens.]
        repeat through the understand-as lines for the verb:
            now the chosen grammar is the verb's next understand-as line after the chosen grammar;
            now where inferring the pattern from is 0;
            now the number of parameters in the command is 0;
            now the count of non-objects is 0;
            now the numeric word is a word unknown by the game;
            change the multiple-object list to have 0 elements;
            now the kind of multi is 'something';
            now the latest parser error is the didn't understand error;
            now the parser's current word position is the verb's position + 1;
            if trace 1, say "[if the trace testing command setting is at least 2][line break][end if][bracket]line [chosen][the current grammar line][close bracket][line break]";
            [ PARSER LETTER F ] [ Look ahead for advance warning for |multiexcept|/|multiinside|.]
            now the likely second noun is the used-up object;
            now the indefinite article mode is false;
            let how many parameters lookahead found be 0;
            now the understood command's current position is 0;
            let word be an understood word;
            [ begin Lookahead ]
            while this grammar element is not the end of line token:
                now the scope decider is the nothing rule;
                if this token's type is not '<understood word>':
                    increment how many parameters lookahead found;
                if this token's type is '<grammar token>':
                    if this grammar token is 'things':
                        we now allow multiple objects unconditionally;
                    if this grammar token is either 'other things' or 'things inside' and how many parameters lookahead found is 1:
                        [ First non-preposition is "multiexcept" or "multiinside", so look ahead. ]
                        if trace 2, say " [bracket]Trying look-ahead[close bracket][line break]";
                        [ We need this to be followed by 1 or more prepositions. ]
                        increment the understood command's current position;
                        if this token's type is '<understood word>':
                            [ skip ahead to a preposition word in the input ]
                            (now the word is the next word) until the parser's current word position > the number of words in the command or (the word is not a word unknown by the game and the usages of the word include being a preposition);
                            if the parser's current word position > the number of words in the command:
                                if trace 2, say " [bracket]Look-ahead aborted: prepositions missing[close bracket][line break]";
                                (go down to where our LineFailed);
                        while this isn't done:
                            if the word is one of the slashed synonyms that start at the (understood command's current position) position:
                                now the understood command's current position is the understood command's current position advanced past the slashed synonyms;
                            [otherwise:
                                increment pcount;]
                            otherwise:
                                [ try to find another preposition word ]
                                (now the word is the next word) until the parser's current word position >= the number of words in the command or (the word is not a word unknown by the game and the usages of the word include being a preposition);
                                if the word is not a word unknown by the game and the usages of the word include being a preposition:
                                    increment the understood command's current position; [line 200]
                                    next;
                                [ lookahead failed ]
                                if trace 2, say " [bracket]Look-ahead aborted: prepositions don't match[close bracket][line break]";
                                (go down to where our LineFailed);
                            now the word is the next word;
                        do that again until this token's type is not '<understood word>';
                        [ put back the non-preposition we just read ]
                        decrement the parser's current word position;
                        if this token's type is '<grammar token>' and this grammar token is 'something':
                            now any problems is the result of parsing determiners like ALL\OTHER\FIVE\MY\THESE\HIS\THE\AN\SOME\etc;
                            unless any problems is no errors here:
                                now the latest parser error is any problems; [ don't allow multiple objects]
                            let temp obj be the parser's returned noun;
                            save temp obj;
                            save the number of parameters in the command;
                            now the number of parameters in the command is 1;
                            change the parser's returned noun to nothing;
                            let pu be the noun domain actor's scopewise location and the person asked under 'something';
                            restore the number of parameters in the command;
                            restore temp obj;
                            change the parser's returned noun to temp obj;
                            if trace 2, say " [bracket]Advanced to 'something' token: [if pu is the misunderstood command]re-parse request[else if pu is noun domain's bunch of objects]but multiple found[else if pu is noun domain's no match]error [latest parser error][else if pu is currently an object][the pu as an object][end if][close bracket][line break]";
                            if pu is the misunderstood command, (go back up to where we ReParse);
                            if pu is currently an object, now the likely second noun is pu as an object;
                break; [while this grammar element is not the end of line token ]
            [ end LOOKAHEAD ]
            [ Slightly different line-parsing rules will apply to "take multi", to prevent "take all" behaving correctly but misleadingly when there's nothing to take.]
            now the TAKE ALL exception is 0;
            if we allow multiple objects unconditionally and the number of parameters for this line is 1 and the action to be is the taking action:
                now the TAKE ALL exception is 1;
            [ And now start again, properly, forearmed or not as the case may be. As a precaution, we clear all the variables again (they may have been disturbed by the call to NounDomain, which may have called outside code, which may have done anything!). ]
            now where inferring the pattern from is at the 0th position;
            now the number of parameters in the command is 0;
            now the count of non-objects is 0;
            now the numeric word is a word unknown by the game;
            change the multiple-object list to have 0 elements;
            now the latest parser error is the didn't understand error;
            now the parser's current word position is the verb's position + 1;
            [ Chapter - Parser Letter G] [Parse each token in turn (calling |ParseToken| to do most of the work). The |pattern| gradually accumulates what has been recognised so far, so that it may be reprinted by the parser later on.]
            now the understood command's current position is 0;
            repeat forever: [ loops on pcount = 1 upward ] [while this grammar element is not the end of line token?]
                increment the understood command's current position;
                change (the understood command's current position) element of the player's understood command to the null pattern;
                now the scope decider is the nothing rule;
                let the token be (understood command's current position - 1) element of the grammar line tokens;
                let the lookahead be (understood command's current position) element of the grammar line tokens;
                if trace 2, say " [bracket]line [chosen] token [understood command's current position] word [parser's current word position] : [token][close bracket][line break]";
                if the token is not the end of line token:
                    now the reason for deciding scope is because we're parsing the predicate nouns;
                    split the token into the current grammar token & current token type;
                    let pr be the parsing of current grammar token as current token type at (understood command's current position - 1) under the token;
                    while the pr is at least reparsing as 'something' and reparsing as the end of line token is at least the pr:
                        now pr is the parsing of (pr as a grammar token) as '<grammar token>' at 0 under 'something';
                    now the reason for deciding scope is because we're parsing the predicate nouns;
                    let pu be noun domain's no match[a pattern union];
                    if pr is parse succeeds:
                        if the current token type is not '<understood word>' and (the current token type is not '<grammar token>' or the current grammar token is not 'text'):
                            decrement the number of parameters for this line;
                        now pu is the pattern matched successfully;[1]
                    otherwise if pr is at most parse fails:
                        now pu is noun domain's no match;[0]
                    otherwise if pr is not reparsing:
                        if pr is parse succeeds as the-K-understood: [1]
                            if the count of non-objects is 0:
                                now the first KOV parameter is the parsed number in question;
                            otherwise:
                                now the second KOV parameter is the parsed number in question;
                            increment the count of non-objects;
                            now pu is the pattern matched successfully;[1]
                        otherwise if pr is the resulting objects: [2]
                            now pu is a bunch of objects;[0]
                        otherwise:
                            now pu is pr as an object as a successful match;
                        change the parser's returned noun # (number of parameters in the command) to pu as an object;
                        increment the number of parameters in the command;
                        change (the understood command's current position) element of the player's understood command to pu;
                        now pu is the pattern matched successfully;[1]
                    if trace 3, say " [bracket]token resulted in [if pr is reparsing]re-parse request[else if pu is the pattern matched successfully]success[else if pu is noun domain's no match]failure with error type [latest parser error as a debugging number][end if][close bracket][line break]";
                    if pr is reparsing:
                        (go back up to where we ReParse);
                    if pu is noun domain's no match, break; [LineFailed]
                otherwise:
                    [ If the player has entered enough already but there's still text to wade through: store the pattern away so as to be able to produce a decent error message if this turns out to be the best we ever manage, and in the mean time give up on this line. However, if the superfluous text begins with a comma or "then" then take that to be the start of another instruction ]
                    if the parser's current word position <= the number of words in the command:
                        let word be the next word;
                        if the word is the comma or the word is synonymous with 'THEN':
                            we still have more to parse;
                            now the word position we held back at is the parser's current word position - 1;
                        otherwise:
                            copy 32 elements from the player's understood command to the player's saved understood command;
                            now the second understood command's current position is the understood command's current position;
                            now latest parser error is the only understood as far as error;
                            break; [LineFailed]
                    [ Now, we may need to revise the multiple object because of the single one we now know (but didn't when the list was drawn up). ]
                    if the number of parameters in the command is at least 1 and the parser's returned noun is nothing:
                        filter the multiple-object list by the grammar token & the parser's returned second noun;
                        if the number of elements in the multiple-object list is 0:
                            now the latest parser error is the nothing to do error;
                            change the parser's returned action to the action to be;
                            break; [LineFailed]
                    if the number of parameters in the command is at least 2 and the parser's returned second noun is nothing:
                        filter the multiple-object list by the grammar token & the parser's returned noun;
                        if the number of elements in the multiple-object list is 0:
                            now the latest parser error is the nothing to do error;
                            break; [LineFailed]
                    [ To trap the case of "take all" inferring only "yourself" when absolutely nothing else is in the vicinity... ]
                    if the TAKE ALL exception is 2 and the parser's returned noun is the person asked:
                        now the best parser error so far is the nothing to do error;
                        (go down to where we GiveError);
                    LINE SUCCESSFULLY PARSED; [line 300]
                    [ ...and return from the parser altogether, having successfully matched a line.]
                    if we still have more to parse:
                        now the parser's current word position is the word position we held back at;
                        if any additional words present a problem:
                            (go down to where we GiveError);
                    STOP; [SUCCESS!]
                [ end of " if the token is not the end of line token) ... otherwise ... " ]
            [ end of for(pcount++) (repeat forever) or, while this grammar element is not the end of line token? ]
            [ Chapter - Parser Letter H ]
            At this point our LineFailed;
            [ The line has failed to match. We continue the outer "for" loop, trying the next line in the grammar. ]
            if the latest parser error is more specific than best parser error so far:
                now the best parser error so far is the latest parser error;
            if the latest parser error is not the noun did not make sense in that context error and the latest parser error is more specific than the second-best parser error so far:
                now the second-best parser error so far is the latest parser error;
            [ ...unless the line was something like "take all" which failed because nothing matched the "all", in which case we stop and give an error now. ]
            if the TAKE ALL exception is 2 and the latest parser error is the nothing to do error, break;
        [ end of repeat through the understand-as lines for the verb: ]
        [ The grammar is exhausted: every line has failed to match.]
        At this point we GiveError;
        let what to do next be give a parser error;
        if what to do next is reparsing:
            go back up to where we AlmostReParse;
        if what to do next is parse fails:
            go back up to where we ReType;
    [ if what to do next is parse succeeds: [ with the Answering It That action ]
            stop. [line 319]]

    To LINE SUCCESSFULLY PARSED:
        if trace 1, say "[bracket]Line successfully parsed[close bracket][line break]";
        [ The line has successfully matched the text. Declare the input error-free...]
        now where the previous typo's at is 0;
        [ ...explain any inferences made (using the pattern)... ]
        if where inferring the pattern from is not 0:
            clarify the parser's choice of the (where inferring the pattern from) -th element;
            reset the paragraph-breaking mechanism;
        [ ...copy the action number, and the number of parameters...]
        change the parser's returned action to the action to be;
        change the parser's returned parameter count to the number of parameters in the command;
        [ ...reverse first and second parameters if need be...]
        if the action's nouns swapped places is true and the number of parameters in the command is 2:
            let temp obj be the parser's returned noun;
            change the parser's returned noun to the parser's returned second noun;
            change the parser's returned second noun to the temp obj;
            if the count of non-objects is 2:
                let temp num be the first KOV parameter;
                now first KOV parameter is the second KOV parameter;
                now second KOV parameter is the temp num;
        [ ...and to reset "it"-style objects to the first of these parameters, if there is one (and it really is an object)... ]
        if the number of parameters in the command > 0 and the parser's returned noun is not currently a kind-of-value, set pronouns from the parser's returned noun.


    To decide what parser result is give a parser error (this is Parser__parse GiveError):
        now the latest parser error is the best parser error so far;
        if the person asked is not the player:
            if the predicate's position is not 0:
                now the verb's position is the predicate's position;
                decide on reparsing;
            change the parser's returned action to the ANSWERING IT THAT action;
            change the parser's returned noun to the person asked;
            change the parser's returned second noun to (parse succeeds as the-K-understood) as an object;
            change the parser's returned parameter count to 2;
            now the parser's current word position is the verb's position;
            now the numeric word is the next word;
            if the numeric word is the comma:
                now the numeric word is the next word;
                increment the verb's position;
            now first KOV parameter is the numeric word as a number;
            now the person asked is the player;
            now the position of the topic understood is the verb's position;
            now the length of the topic understood is the number of words in the command + 1 - the position of the topic understood;
            decide on parse succeeds;
        otherwise if the latest parser error contains text:
            if the latest parser error issued as a low-level parser error is 0:
                consider the standard print parser error rule [instead];
        otherwise:
            if the verb's position is 0 and the latest parser error is the can’t see any such thing error:
                now the latest parser error is the not a verb I recognise error;
            now the player's command is the empty snippet lengthened by the word count;
            begin the PRINTING A PARSER ERROR ACTIVITY;
            if handling the PRINTING A PARSER ERROR ACTIVITY:
                consider the standard print parser error rule;
            we should pending paragraph break;
            end the PRINTING A PARSER ERROR ACTIVITY;
            if we should call GiveError afterward:
                we no longer call GiveError afterward;
                decide on give a parser error;
        decide on parse fails.

    Call GiveError afterward is a truth state that varies.
    Call GiveError afterward is usually false.

    [ this is PARSER LETTER I & J ]
    Last for printing a parser error (this is the standard print parser error rule):
        now the pronoun used is the saved pronoun used;
        now the pronoun reference object is the saved pronoun reference object;
        if the latest parser error is:
            -- didn’t understand error:
                issue the 27th response "I didn’t understand that sentence.";
                now where the previous typo's at is at the 1st position;
            -- only understood as far as error:
                issue the 28th response "I only understood you as far as wanting to ";
                copy 32 elements from the player's saved understood command to the player's understood command;
                now the understood command's current position is the second understood command's current position;
                say "[recap of command from 0]";
                issue the 56th response ".";
            -- didn’t understand that number error:
                issue the 29th response "I didn’t understand that number.";
            -- can’t see any such thing error:
                issue the 30th response "You can’t see any such thing.";
                now where the previous typo's at is remember where the typo's at;
            -- said too little error:
                issue the 31st response "You seem to have said too little.";
            -- aren’t holding that error:
                issue the 32nd response "You aren’t holding that.";
                now where the previous typo's at is remember where the typo's at;
            -- can’t use multiple objects error:
                issue the 33rd response "You can’t use multiple objects with that verb."; [line 400]
            -- can only use multiple objects error:
                issue the 34th response "You can only use multiple objects once on a line.";
            -- not sure what it refers to error:
                issue the 35th response "I’m not sure what 'it' refers to.";
            -- excepted something not included error:
                issue the 36th response "You excepted something not included anyway!";
            -- can only do that to something animate error:
                issue the 37th response "You can only do that to something animate.";
            -- not a verb I recognise error:
                issue the 38th response "That’s not a verb I recognise.";
            -- not something you need to refer to error:
                issue the 39th response "That’s not something you need to refer to in the course of this game.";
            -- can’t see it at the moment error:
                if the pronoun reference object is the used-up object:
                    issue the 35th response "I'm not sure what 'it' refers to.";
                otherwise:
                    issue the 40th response "You can't see 'it' (the chew toy) at the moment.";
            -- didn’t understand the way that finished error:
                issue the 41st response "I didn’t understand the way that finished.";
            -- not enough of those available error:
                issue the 42nd response with the number of items actually received ["Only X are available"];
            -- nothing to do error:
                if the parser's returned action is the removing it from action and the parser's returned second noun is currently an object:
                    now the noun is the parser's returned second noun; [ ensure valid for messages ]
                    if the noun provides the property animate directly:
                        issue the 6th message for the taking action;
                    otherwise unless the noun is a supporter or container:
                        issue the 2nd message for the inserting it into action;
                    otherwise if noun is a closed container:
                        issue the 9th message for the taking action;
                    otherwise if nothing is in the noun:
                        issue the 6th message for the searching action;
                    otherwise:
                        change the parser's returned action to the default value of action names;
                if the parser's returned action is not the removing it from action:
                    if the number of items wanted previously wanted is 100:
                        issue the 43rd response "Nothing to do!";
                    otherwise:
                        issue the 44th response "There are none at all available!";
            -- noun did not make sense in that context error:
                now the scope stage is please report the noun not making sense in this context;
                if the parser result produced by the context that this noun didn't make sense within is parse fails:
                    now the best parser error so far is the second-best parser error so far;
                    [unless the latest parser error contains text:
                        end the PRINTING A PARSER ERROR ACTIVITY;]
                    we should call GiveError afterward;
                    [go back up to where (give a parser error);]
            -- referred to a determination of scope error:
                issue the 73rd response "That noun did not make sense in this context.";
            -- I beg your pardon error:
                issue the 10th response "I beg your pardon?" [448]


    [Last thing: check for THEN and further instructions(s), return. At this point, the return value is all prepared, and we are only looking to see if there is a "then" followed by subsequent instruction(s). ]
    To decide if any additional words present a problem (this is Parser__parse Part K LookForMore):
        if the parser's current word position > the number of words in the command:
            no;
        let the word be the next word;
        if the word is synonymous with 'THEN' or the word is the comma:
            if the parser's current word position > the number of words in the command:
                we no longer have more to parse;
                no;
            [i = WordAddress(the verb's position);
            j = WordAddress(the parser's current word position);]
            let the saved position be the parser's current word position;
            shift the player's input buffer left by (the parser's current word position - the verb's position) starting at the parser's current word position;
            shift the AGAIN input buffer left by (the parser's current word position - the verb's position) starting at the parser's current word position;
            PARSE the player's input buffer into the player's parsed command;
            now the parser's current word position is 1;
            [for (: i<j : i++) i->0 = ' ';]
            now the word is the next word;
    [ if the word is 'AGAIN':
                [ Delete the words "then again" from the again buffer to prevent an infinite loop on "i. again" ]
    [ i = WordAddress(the saved position - 2) - buffer;
                if (wn > num_words) j = INPUT_BUFFER_LEN-1;
                else j = WordAddress(the saved position) - buffer;
                for (: i<j : i++) buffer3->i = ' ';]
                shift the AGAIN input buffer left by the 1st word's length of the player's parsed command starting at the 1st word's length of the player's parsed command;
            PARSE the player's input buffer into the player's parsed command;]
            we still have more to parse;
            no;
        now the best parser error so far is the only understood as far as error;
        yes.
    [ decide on give a parser error.] [466 lines]


    [[[[[-). ]]]]]