diff options
| author | aarne <aarne@cs.chalmers.se> | 2007-09-19 13:49:12 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2007-09-19 13:49:12 +0000 |
| commit | 7825a1a1c54d6922c709bed7de3f23f049e0046e (patch) | |
| tree | 9eedd42bf67ae46b8f233234064c1edce133587c /src/GF/Canon/GFCC/PrintGFCC.hs | |
| parent | a886f7042b2ad16fa3ef120548df9773ffafbb45 (diff) | |
adapted GFCC2FCFG to other uses of GFCC, made it to default parser
Diffstat (limited to 'src/GF/Canon/GFCC/PrintGFCC.hs')
| -rw-r--r-- | src/GF/Canon/GFCC/PrintGFCC.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/GF/Canon/GFCC/PrintGFCC.hs b/src/GF/Canon/GFCC/PrintGFCC.hs index 1ef7cfbe3..05a9246cd 100644 --- a/src/GF/Canon/GFCC/PrintGFCC.hs +++ b/src/GF/Canon/GFCC/PrintGFCC.hs @@ -69,11 +69,10 @@ prPrec :: Int -> Int -> Doc -> Doc prPrec i j = if j<i then parenth else id -instance Print Int where +instance Print Integer where prt _ x = doc (shows x) - -instance Print Integer where +instance Print Int where prt _ x = doc (shows x) @@ -157,8 +156,7 @@ instance Print Term where R terms -> prPrec i 0 (concatD [doc (showString "[") , prt 0 terms , doc (showString "]")]) P term0 term -> prPrec i 0 (concatD [doc (showString "(") , prt 0 term0 , doc (showString "!") , prt 0 term , doc (showString ")")]) S terms -> prPrec i 0 (concatD [doc (showString "(") , prt 0 terms , doc (showString ")")]) - KS str -> prPrec i 0 (concatD [prt 0 str]) - KP strs variants -> prPrec i 0 (concatD [doc (showString "[") , doc (showString "pre") , prt 0 strs , doc (showString "[") , prt 0 variants , doc (showString "]") , doc (showString "]")]) + K tokn -> prPrec i 0 (concatD [prt 0 tokn]) V n -> prPrec i 0 (concatD [doc (showString "$") , prt 0 n]) C n -> prPrec i 0 (concatD [prt 0 n]) F cid -> prPrec i 0 (concatD [prt 0 cid]) @@ -174,6 +172,11 @@ instance Print Term where [x] -> (concatD [prt 0 x]) x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) +instance Print Tokn where + prt i e = case e of + KS str -> prPrec i 0 (concatD [prt 0 str]) + KP strs variants -> prPrec i 0 (concatD [doc (showString "[") , doc (showString "pre") , prt 0 strs , doc (showString "[") , prt 0 variants , doc (showString "]") , doc (showString "]")]) + instance Print Variant where prt i e = case e of |
