--------------------------------------------------------------------------------
--                                                                            --
-- the main driver loop                                                       --
--                                                                            --
--------------------------------------------------------------------------------

driver prompt parseWith unparse interpreter run
  = do
     put "ModularInterpreter\n"
     put "author: Luc Duponcheel\n"
     put "all comments are welcome (luc@cs.ruu.nl)\n"
     forever doit
    where  
     doit = do
             put prompt
             str <- getline
             parseWith cont str
             put "\n"
     cont expr = do
                  put "   after parse:\n   " 
                  unparse expr 
                  put "\n" 
                  put "   after interpret:\n   " 
                  run (interpreter expr) 

--------------------------------------------------------------------------------


