summaryrefslogtreecommitdiff
path: root/src/GF
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2008-10-15 07:47:57 +0000
committerkrasimir <krasimir@chalmers.se>2008-10-15 07:47:57 +0000
commit5f33e0bda955c66aa81356c6636ec65d9a40bc2e (patch)
tree2500b5ba571901235a944a4a832532f17aeb98ca /src/GF
parent57ee52103dcccbcda75b895ea399e230e18d0a92 (diff)
store the total number of PMCFG categories in the PGF file
Diffstat (limited to 'src/GF')
-rw-r--r--src/GF/Compile/GenerateFCFG.hs1
-rw-r--r--src/GF/Compile/GeneratePMCFG.hs1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/GF/Compile/GenerateFCFG.hs b/src/GF/Compile/GenerateFCFG.hs
index de6c05ef1..108976506 100644
--- a/src/GF/Compile/GenerateFCFG.hs
+++ b/src/GF/Compile/GenerateFCFG.hs
@@ -330,6 +330,7 @@ getParserInfo (GrammarEnv last_id catSet seqSet funSet prodSet) =
, sequences = mkArray seqSet
, productions = prodSet
, startCats = Map.map getFCatList catSet
+ , totalCats = last_id+1
}
where
mkArray map = array (0,Map.size map-1) [(v,k) | (k,v) <- Map.toList map]
diff --git a/src/GF/Compile/GeneratePMCFG.hs b/src/GF/Compile/GeneratePMCFG.hs
index 870396255..20ba80e2e 100644
--- a/src/GF/Compile/GeneratePMCFG.hs
+++ b/src/GF/Compile/GeneratePMCFG.hs
@@ -319,6 +319,7 @@ getParserInfo (GrammarEnv last_id catSet seqSet funSet crcSet prodSet) =
, sequences = mkArray seqSet
, productions = IntMap.union prodSet coercions
, startCats = Map.map (\(start,end,_) -> range (start,end)) catSet
+ , totalCats = last_id+1
}
where
mkArray map = array (0,Map.size map-1) [(v,k) | (k,v) <- Map.toList map]