summaryrefslogtreecommitdiff
path: root/src/GF/CFGM/PrintCFG.hs
diff options
context:
space:
mode:
authorbringert <unknown>2005-05-17 13:04:35 +0000
committerbringert <unknown>2005-05-17 13:04:35 +0000
commit8abf80dc4d4aa9c6a783f41346e44a5012649d03 (patch)
tree6b03cbbffa6b435b57fc6f60a24f10a92ad6a3cd /src/GF/CFGM/PrintCFG.hs
parent31044ec728d3a9a56a660fdd32d880d13dc9ffbf (diff)
Changed CFGM format and printer to allow constants in profiles.
Diffstat (limited to 'src/GF/CFGM/PrintCFG.hs')
-rw-r--r--src/GF/CFGM/PrintCFG.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/GF/CFGM/PrintCFG.hs b/src/GF/CFGM/PrintCFG.hs
index e81be449f..0fd46239c 100644
--- a/src/GF/CFGM/PrintCFG.hs
+++ b/src/GF/CFGM/PrintCFG.hs
@@ -3,7 +3,7 @@ module GF.CFGM.PrintCFG where
-- pretty-printer generated by the BNF converter
import GF.CFGM.AbsCFG
-import Data.Char
+import Char
-- the top-level printing method
printTree :: Print a => a -> String
@@ -112,7 +112,7 @@ instance Print Flag where
instance Print Rule where
prt i e = case e of
- Rule fun profile category symbols -> prPrec i 0 (concatD [prt 0 fun , doc (showString ":") , prt 0 profile , doc (showString ".") , prt 0 category , doc (showString "->") , prt 0 symbols])
+ Rule fun profiles category symbols -> prPrec i 0 (concatD [prt 0 fun , doc (showString ":") , prt 0 profiles , doc (showString ".") , prt 0 category , doc (showString "->") , prt 0 symbols])
prtList es = case es of
[] -> (concatD [])
@@ -124,14 +124,15 @@ instance Print Fun where
Coerce -> prPrec i 0 (concatD [doc (showString "_")])
-instance Print Profile where
+instance Print Profiles where
prt i e = case e of
- Profile intss -> prPrec i 0 (concatD [doc (showString "[") , prt 0 intss , doc (showString "]")])
+ Profiles profiles -> prPrec i 0 (concatD [doc (showString "[") , prt 0 profiles , doc (showString "]")])
-instance Print Ints where
+instance Print Profile where
prt i e = case e of
- Ints ns -> prPrec i 0 (concatD [doc (showString "[") , prt 0 ns , doc (showString "]")])
+ UnifyProfile ns -> prPrec i 0 (concatD [doc (showString "[") , prt 0 ns , doc (showString "]")])
+ ConstProfile id -> prPrec i 0 (concatD [prt 0 id])
prtList es = case es of
[] -> (concatD [])