diff options
| author | krasimir <krasimir@chalmers.se> | 2010-01-17 17:05:21 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-01-17 17:05:21 +0000 |
| commit | af13bae2dfb9adaa7c4aa273961fc09cc7ba1b7a (patch) | |
| tree | 74ba570e4d202dff02f330b50e11a0fa09b068a6 /src/runtime/haskell/PGF/Binary.hs | |
| parent | 9e3d4c74dc807cb26bb36303d2157c70c0668a8e (diff) | |
now the linearization is completely based on PMCFG
Diffstat (limited to 'src/runtime/haskell/PGF/Binary.hs')
| -rw-r--r-- | src/runtime/haskell/PGF/Binary.hs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/runtime/haskell/PGF/Binary.hs b/src/runtime/haskell/PGF/Binary.hs index 7d5db73af..a9a6a78dc 100644 --- a/src/runtime/haskell/PGF/Binary.hs +++ b/src/runtime/haskell/PGF/Binary.hs @@ -2,6 +2,7 @@ module PGF.Binary where import PGF.CId
import PGF.Data
+import PGF.Macros
import Data.Binary
import Data.Binary.Put
import Data.Binary.Get
@@ -28,10 +29,11 @@ instance Binary PGF where gflags <- get
abstract <- get
concretes <- get
- return (PGF{ absname=absname, cncnames=cncnames
- , gflags=gflags
- , abstract=abstract, concretes=concretes
- })
+ return $ updateProductionIndices $
+ (PGF{ absname=absname, cncnames=cncnames
+ , gflags=gflags
+ , abstract=abstract, concretes=concretes
+ })
instance Binary CId where
put (CId bs) = put bs
@@ -185,15 +187,16 @@ instance Binary Production where _ -> decodingError
instance Binary ParserInfo where
- put p = put (functions p, sequences p, productions0 p, totalCats p, startCats p)
+ put p = put (functions p, sequences p, productions p, totalCats p, startCats p)
get = do functions <- get
sequences <- get
- productions0<- get
+ productions <- get
totalCats <- get
startCats <- get
return (ParserInfo{functions=functions,sequences=sequences
- ,productions0=productions0
- ,productions =filterProductions productions0
+ ,productions = productions
+ ,pproductions = IntMap.empty
+ ,lproductions = Map.empty
,totalCats=totalCats,startCats=startCats})
decodingError = fail "This PGF file was compiled with different version of GF"
|
