Interactive Parsing

version 3 by Jon Ingold

  • Home page
  • Beginning
  • Previous
  • Next



  • Section 2 - Debugging (not for release)

    [
    Some debug info. Mostly redundant now.
    ]

    Include (-

    [ PrintStats print_buffer length i;

        if (length > 0)
        {

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

            print "^^Stats:^";
            print "WordCount() = ", WordCount(), "^";
            
            if (WordLength(WordCount()) > 1)
            {
                i = WordAddressInBuffer(WordCount(), print_buffer);
                print "WordAddress() = ", (char) i->0, (char) i->1, "...^";
            }
            
            print "Current word length = ", WordLength(WordCount()), "^";
            print "Buffer length typed = ", length, "^";
            
            print "Place in buffer = ", CharacterAddress(WordCount()), "/", CharacterNumber(WordCount()), "^";
        }

    ];

    -).