Interactive Parsing

version 3 by Jon Ingold

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Reading and Writing Command Lines

    Include (-

    [ WriteBufferToCommandLine input_buffer storage_start_point
        i
        ;
        for (i = 0 : i < input_buffer-->0 : i++)
            command_lines->(i + storage_start_point) = input_buffer->(i + WORDSIZE);
        
    ];

    [ WriteCharactersToBuffer
        from_ar from_start from_length to_ar
        i
        ;
    ! glk_set_window((+main-window+).ref_number);

    ! print "Writing out characters: from ", from_start, " , length = ", from_length, ".^";

        for (i = 0: i < from_length: i++)
        {
            to_ar->(WORDSIZE + i) = from_ar->(from_start + i);
    ! print (char) to_ar->(WORDSIZE+i);
        }
    ! print "^";
        to_ar--> 0 = from_length;
    ];



    -).