-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathannos.hs
41 lines (34 loc) · 1.04 KB
/
annos.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{- |
Module : $Id$
Description : test some parsers (and printers) for annotations
Copyright : (c) Christian Maeder, Uni Bremen 2002-2005
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : experimental
Portability : portable
test some parsers (and printers) for annotations
-}
module Main where
import Common.Token
import Common.RunParsers
import Common.AnnoParser
import Common.Doc
import Common.DocUtils
import Common.AnalyseAnnos
import Common.ConvertGlobalAnnos ()
main :: IO ()
main = exec lineParser fileParser
lineParser :: [(String, StringParser)]
lineParser =
[ ("MixIds", fromAParser $ parseId [])
, ("VarIds", fromAParser $ varId [])
, ("SortIds", fromAParser $ sortId [])
, ("Annos", fromAParser annotationL) ]
fileParser :: [(String, StringParser)]
fileParser =
[ ("Annotations", \ ga -> fmap
(show . useGlobalAnnos ga . vcat . map pretty)
annotations)
, ("GlobalAnnos", \ ga -> fmap
(show . useGlobalAnnos ga . pretty . addGlobalAnnos ga)
annotations) ]