1
0
forked from GitHub/gf-core

the pmcfg_pretty printer now prints the actual grammar used for parsing

This commit is contained in:
krasimir
2009-09-23 06:28:36 +00:00
parent 884747508e
commit ea10ce93c4

View File

@@ -56,7 +56,7 @@ isLiteralFCat = (`elem` [fcatString, fcatInt, fcatFloat, fcatVar])
ppPMCFG :: ParserInfo -> Doc
ppPMCFG pinfo =
text "productions" $$
nest 2 (vcat [ppProduction (fcat,prod) | (fcat,set) <- IntMap.toList (productions0 pinfo), prod <- Set.toList set]) $$
nest 2 (vcat [ppProduction (fcat,prod) | (fcat,set) <- IntMap.toList (productions pinfo), prod <- Set.toList set]) $$
text "functions" $$
nest 2 (vcat (map ppFun (assocs (functions pinfo)))) $$
text "sequences" $$