Interactive Parsing

version 3 by Jon Ingold

  • Home page
  • Beginning
  • Previous
  • Next



  • Section 4 - System for using previous results

    Include (-

    [ PreviousParseResult new_word
        i ;
        ! returns 1 => success, -1 => fail, and 0 => no known data
        


        !glk_set_window((+main-window+).ref_number);

        for (i = 1 : i <= previous_checks_passed-->0 || i <= previous_checks_failed-->0 : i++)
        {
            if (i <= previous_checks_passed-->0 && previous_checks_passed-->i == new_word)
            {
                !print "Found ", (address) new_word, " in previous PASS! Declaring it OK.^";
                return 1;
            } else
            if (i <= previous_checks_failed-->0 && previous_checks_failed-->i == new_word)
            {
                !print "Found ", (address) new_word, " in previous FAIL! Declaring it BUNK.^";
                return -1;
            }
        }
        
        return 0;
    ];

    -).