changed names of resource-1.3; added a note on homepage on release

This commit is contained in:
aarne
2008-06-25 16:54:35 +00:00
parent b96b36f43d
commit e9e80fc389
903 changed files with 113 additions and 32 deletions

20
old-examples/CLE/CF2GF.hs Normal file
View File

@@ -0,0 +1,20 @@
import Data.List (intersperse)
import Data.Char (isAlpha)
-- to massage cf rules to funs, in order, preserving comments
-- to get cats, use pg -printer=gf
cf2gf :: FilePath -> IO ()
cf2gf file = do
ss <- readFile file >>= return . lines
mapM_ (putStrLn . mkOne) ss
mkOne line = case words line of
fun : cat : "::=" : cats ->
let
(cats0,cats2) = span (/=";") cats
cats1 = filter (isAlpha . head) cats0 ++ [cat]
in
unwords $ [init fun, ":"] ++ intersperse "->" cats1 ++ cats2
_ -> line