Original Parser

version 1 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - ScopeWithin

    [Level 2. |ScopeWithin| puts objects visible from within the |domain| into scope.
    An item belonging to the |domain| is placed in scope unless it is being
    concealed by the |domain|: and even then, if the |domain| is the current
    actor. Suppose Zorro conceals a book beneath his cloak: then the book is
    not in scope to his lady friend The Black Whip, but it is in scope to Zorro
    himself. (Thus an actor is not allowed to conceal anything from himself.)

    Note that the |domain| object itself, and its component parts if any, are
    not placed in scope by this routine, though nothing prevents some other
    code doing so.]

    To place the/-- contents of (domain - an object) in scope: [ from the Standard Rules ]
        place the contents of the domain in scope excluding nothing under 'something'.

    To place the/-- contents of (domain - an object) in/into scope excluding (nosearch - an object) under (context - a grammar token) (this is ScopeWithin):
        if the domain is nothing, stop the action;
        repeat with the possession running through the possessed nodes of the domain:
            if the domain is the person asked or the domain does not conceal the possession:
                recursively do scope action on possession excluding nosearch under the context;


    [ ScopeWithin domain nosearch context obj next_obj;
    if (domain == 0) rtrue;

    ! Look through the objects in the domain, avoiding "objectloop" in case
    ! movements occur.
    obj = child(domain);
    while (obj) {
    next_obj = sibling(obj);
    if ((domain == actor) || (TestConcealment(domain, obj) == false))
    DoScopeActionAndRecurse(obj, nosearch, context);
    obj = next_obj;
    }
    ]