Interactive Parsing

version 3 by Jon Ingold

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter 4 - Initiating Command Line Recall for Disambiguation

    Section 1 - Record the Edit Point

    Include (-

    Global edit_character = -1;

    [ CreateEditPoint chn;
    ! glk_set_window((+main-window+).ref_number);
    !! print "Storing edit point = ", chn, "^";
        edit_character = chn;
    ];

    [ WipeEditPoint;
        edit_character = -1;
    ];

    [ ApplyEditPoint input_buffer chn;
        chn = edit_character;
        WipeEditPoint();
        if (chn > -1)
        {
    ! glk_set_window((+main-window+).ref_number);
    ! print "Applying edit point = ", chn, "^";
            RecallPreviousCommandLine(input_buffer);

            InsertCharacterAt(' ', buffer, chn-1);

            BasicAnalysis(input_buffer, chn);

            PrintInputLine(input_buffer, chn);

            return chn;
        }

        return 0;
    ];

    -) before "Parser.i6t".