hana.hs revision 81ccde0242e645176bf2706c47dd2ec7f1f3b0bb
0N/A{- |
0N/AModule : $Header$
0N/ACopyright : (c) Christian Maeder, Uni Bremen 2002-2004
0N/ALicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
0N/A
0N/AMaintainer : maeder@tzi.de
0N/AStability : experimental
0N/APortability : non-portable
0N/A
0N/Atest the programatica parser and (HatAna) analysis
0N/A
0N/A-}
0N/A
0N/Amodule Main where
0N/A
0N/Aimport Haskell.HatParser
0N/Aimport Haskell.HatAna
0N/Aimport ParseMonad
0N/Aimport PropLexer
0N/Aimport PropParser as HP
0N/Aimport PropPosSyntax
0N/A
0N/Aimport System.Environment
0N/A
0N/Aimport Common.Result
0N/Aimport Common.Print_AS_Annotation()
0N/Aimport Common.GlobalAnnotations
0N/Aimport Common.DocUtils
0N/A
0N/Amain :: IO ()
0N/Amain = getArgs >>= mapM_ process
0N/A
0N/A-- try with files ToHaskell/test/*.hascasl.hs
0N/Aprocess :: FilePath -> IO ()
0N/Aprocess fn = do
0N/A s <- readFile fn
0N/A let ts = pLexerPass0 True s
0N/A Result ds m = do
0N/A HsModule _ _ _ _ b <- parseTokens HP.parse fn ts
0N/A hatAna(HsDecls b, emptySign, emptyGlobalAnnos)
0N/A case m of
0N/A Just (_, _, sig, hs) -> do
0N/A putStrLn $ showDoc sig ""
0N/A mapM_ (putStrLn . flip showDoc "") hs
0N/A _ -> mapM_ (putStrLn . show) ds
0N/A
0N/A