From 7825a1a1c54d6922c709bed7de3f23f049e0046e Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 19 Sep 2007 13:49:12 +0000 Subject: adapted GFCC2FCFG to other uses of GFCC, made it to default parser --- src/GF/Canon/GFCC/PrintGFCC.hs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/GF/Canon/GFCC/PrintGFCC.hs') 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 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 -- cgit v1.2.3