Original Parser

version 1 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next

  • Chapter - Noun Domain

    [|NounDomain| does the most substantial part of parsing an object name.
    It is given two ``domains'' -- usually a location and then the actor who is
    looking -- and a context (i.e. token type), and returns:

    (a) 0 if no match at all could be made,
    (b) 1 if a multiple object was made,
    (c) $k$ if object $k$ was the one decided upon,
    (d) |REPARSE_CODE| if it asked a question of the player and consequently
    rewrote the player's input, so that the whole parser should start again
    on the rewritten input.

    In case (c), |NounDomain| also sets the variable |length_of_noun| to the
    number of words in the input text matched to the noun. In case (b),
    the multiple objects are added to |multiple_object| by hand (not by |MultiAdd|,
    because we want to allow duplicates).]