makefile fix and table with results so far added to ex3
[tt2015.git] / a3 / code / Generics / GenParse.dcl
1 definition module GenParse
2
3 import StdGeneric, StdMaybe
4
5 class ParseInput s where
6 parseInput :: s -> (Maybe Char, s)
7
8 :: StringInput = { si_str :: !String, si_pos :: !Int}
9 mkStringInput :: String -> StringInput
10
11 instance ParseInput StringInput
12 instance ParseInput File
13
14 :: Expr
15 generic gParse a :: Expr -> Maybe a
16
17 derive gParse Int, Char, Bool, Real, String, UNIT, PAIR, EITHER, CONS, FIELD, OBJECT, [], {!}, {}
18
19 parseString :: String -> Maybe a | gParse{|*|} a
20 parseFile :: File -> Maybe a | gParse{|*|} a