diff options
Diffstat (limited to 'examples/CLE/CF2GF.hs')
| -rw-r--r-- | examples/CLE/CF2GF.hs | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/examples/CLE/CF2GF.hs b/examples/CLE/CF2GF.hs deleted file mode 100644 index 1bb1d6611..000000000 --- a/examples/CLE/CF2GF.hs +++ /dev/null @@ -1,20 +0,0 @@ -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 -
\ No newline at end of file |
