From 87fffffbdf41eaf0f269bd65d8380b80d899bec8 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Tue, 10 Dec 2013 10:43:13 +0000 Subject: option --split-pgf replaces option --mk-index. This splits the PGF into one file for the abstract and one more for each concrete syntax. This is a preparation for being able to load only specific languages from the whole grammar. --- src/runtime/haskell/PGF/Binary.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/runtime/haskell') diff --git a/src/runtime/haskell/PGF/Binary.hs b/src/runtime/haskell/PGF/Binary.hs index bf30e4506..becf5b9de 100644 --- a/src/runtime/haskell/PGF/Binary.hs +++ b/src/runtime/haskell/PGF/Binary.hs @@ -49,7 +49,15 @@ instance Binary Abstr where , cats=fmap (\(x,y,z) -> (x,y,z,0)) cats , code=BS.empty }) - + +putSplitAbs :: PGF -> Put +putSplitAbs pgf = do + putWord16be pgfMajorVersion + putWord16be pgfMinorVersion + put (Map.insert (mkCId "index") (LStr "true") (gflags pgf)) + put (absname pgf, abstract pgf) + put [(name,cflags cnc) | (name,cnc) <- Map.toList (concretes pgf)] + instance Binary Concr where put cnc = do put (cflags cnc) put (printnames cnc) -- cgit v1.2.3