module Main where import AST import Parser import Text.ParserCombinators.Parsec before = "module Main where\n\n\ \\n\ \import AST \n\ \import Interpreter \n\ \\n\ \\n\ \ast = " after = "main = do { res <- return (interpretFile ast); putStrLn (showHCAS res); } \n\ \\n\ \\n\ \\n\ \\n" main = do { script <- getContents; case (parse file "" script) of (Right parsed) -> do { putStr (before); putStrLn (showHaskell parsed); putStrLn (after); } (Left err) -> do { putStrLn (show err); } }