Interactive Parsing

version 3 by Jon Ingold

  • Home page
  • Beginning
  • Previous
  • Next



  • Book 2 - Input Window Functionality

    Chapter 1 - Producing the Input Window

    Section 1 - Main Printing Loop

    Include (-

    Constant NORMAL = style_Normal;
    Constant ERROR = style_User2;
    Constant LONGWORD_ERROR = stylehint_Proportional;
    Constant VALID = style_User1;
    Constant TIP = style_Input;
    Constant MISPLACED = style_Note;
    Constant RETURN_STYLE = style_Emphasized;
    Constant CURSOR_STYLE = style_Alert;

    Array word_colours -> 50; ! store the chosen colours

        [ PrintInputLine a_buffer cur_pos;
            wn = 1;
            PrintPromptInWindow();
            PrintTypedCommand(a_buffer, a_buffer-->0, cur_pos);
            
            !PrintCursor(cur_pos);
            
            #ifdef DEBUG;
                !PrintStats(print_buffer, length);
            #endif;

            
        ];


    -)