class
     PROCESS

inherit
     POLY_LEX

create
     make

feature

     root_line: LINE

     make is
           local
                 nb_try: INTEGER
                 t_b: BOOLEAN
                 text_name: STRING
           do
                 create root_line.make
                 build (root_line.document)
                 io.putstring ("Do you want to test for left recursion? ")
                 io.readword
                 io.next_line
                 if io.laststring.is_equal ("y") then
                       root_line.print_mode.put (True)
                       root_line.expand_all
                       t_b := not root_line.left_recursion
                       root_line.check_recursion
                       if not root_line.left_recursion.item then
                             io.putstring ("No left recursion detected%N")
                       end
                 else
                       from
                       until
                             nb_try < 5 and text_name /= void and then text_name.count > 0
                       loop
                             io.putstring ("File name with polynom description: ")
                             io.readword
                             text_name := io.laststring
                             nb_try := nb_try + 1
                       end
                       if nb_try = 5 then
                             io.putstring ("*** Demo stopped%N")
                       else
                             root_line.document.set_input_file (text_name)
                             root_line.document.get_token
                             root_line.process
                       end
                 end
           end
     
end -- class PROCESS