Disambiguation Control

version 7 by Jon Ingold

  • Home page
  • Beginning
  • Previous
  • Next



  • Volume - New Parser Messages

    [ Thanks to Ron Newcomb for this code block. ]

    Table of Disambiguation Messages
    message-id  message text  
    1  "Please be more specific - "  
    2  "Whom do you want[actor-or-player] to [print-or-construct]: "  
    3  "What do you want[actor-or-player] to [print-or-construct]: "  
    4  "Whom do you want[actor-or-player] to [print-or-construct]?[paragraph break]"  
    5  "What do you want[actor-or-player] to [print-or-construct]?[paragraph break]"  
    6  "whom do you want[actor-or-player] to [print-or-construct]: "  
    7  "what do you want[actor-or-player] to [print-or-construct]: "  
    8  "whom do you want[actor-or-player] to [print-or-construct]?[paragraph break]"  
    9  "what do you want[actor-or-player] to [print-or-construct]?[paragraph break]"  
    10  "?[line break]"  
    11  "?[paragraph break]"  
    12  "You can only have one item here. Which exactly?"  
    20  "take things from"  
    21  "put things in"  
    22  "put things on"  


    The message-id-requested is a number that varies.

    This is the disambiguation printing rule:
        say the message text corresponding to a message-id of the message-id-requested in the Table of Disambiguation Messages.


    To say actor-or-player: (-ActorOrPlayer(); -).
    To say print-or-construct: (- PrintOrConstruct(); -).

    Include (-


    [ ParserMessage n m;
    ! print "--- ", n, " ----^";

    ! we swap messages if we're in indef mode

        if (indef_wanted > 0)
        {
            m = 0;
            switch(n)
            {
                2: m = 6;
                3: m = 7;
                4: m = 8;
                5: m = 9;
            }
            if (m > 0) ! m had better never equal any of the values listed above!!
            {
                ParserMessage(1);
                ParserMessage(m);
                rtrue;
            }
            
        }


        (+message-id-requested+) = n;
        (+disambiguation printing rule+)();

    ];

    [ ActorOrPlayer i;
         i = 1;
    if (actor~=player) print " ", (the) actor;
        #ifdef FIRST_PERSON;
            if (actor == player) print " me";
        #endif;
    ];


    [ PrintOrConstruct ;

    if (~~look_ahead) PrintCommand();
        else if (action_to_be == ##Remove) ParserMessage(20);
        else if (action_to_be == ##Insert) ParserMessage(21);
        else if (action_to_be == ##PutOn) ParserMessage(22);

    ! to get here, the user must have created a new action with the Multi_held or multi_inside tokens.
    ! We'll have to let the parser do the best it can

    ! if we get strange messages for new actions, this might be the place to add something in!!

        else PrintCommand();

    ];

    -)



    [ ******************************************************************************************************** ]