[project @ 2003-07-31 10:48:50 by panne]
[ghc-base.git] / Text / ParserCombinators / Parsec / examples / Henk / Main.hs
1 ----------------------------------------------------------------
2 -- Henk
3 -- Copyright 2000, Jan-Willem Roorda
4 ----------------------------------------------------------------
5 module Main where
6
7 import Text.ParserCombinators.Parsec
8
9 import HenkAS
10 import HenkParser
11
12
13 welcome = "__   __ ______ __   __ ____   __________________________________________\n"++
14           "||   || ||  || ||\\  || ||//   Henk 2000: Based on Pure Type Systems     \n"++
15           "||___|| ||_|   ||\\\\ || ||\\\\                                             \n"++
16           "||---|| ||-|__ || \\\\||        WWW http://www.students.cs.uu.nl/~jwroorda\n"++
17           "||   || ||__||                Report bugs to: jwroorda@math.uu.nl       \n"++
18           "||   || Version: Jan 2000     __________________________________________\n\n"
19
20
21
22 test fname     
23         = do{ putStr welcome          
24             ; result <- parseFromFile program (root ++ fname ++ ".h")
25             ; case result of              
26                 Left err -> do{ putStr "parse error at: "
27                               ; print err
28                               }
29                 Right x  -> print x          
30             }
31         where
32           root = ""
33
34
35 main = test "test"
36
37