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.

This commit is contained in:
kr.angelov
2013-12-10 10:43:13 +00:00
parent 2dda42e4d9
commit 87fffffbdf
5 changed files with 29 additions and 52 deletions

View File

@@ -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)