summaryrefslogtreecommitdiff
path: root/examples/big/extract2gf.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-25 16:54:35 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-25 16:54:35 +0000
commite9e80fc389365e24d4300d7d5390c7d833a96c50 (patch)
treef0b58473adaa670bd8fc52ada419d8cad470ee03 /examples/big/extract2gf.hs
parentb96b36f43de3e2f8b58d5f539daa6f6d47f25870 (diff)
changed names of resource-1.3; added a note on homepage on release
Diffstat (limited to 'examples/big/extract2gf.hs')
-rw-r--r--examples/big/extract2gf.hs28
1 files changed, 0 insertions, 28 deletions
diff --git a/examples/big/extract2gf.hs b/examples/big/extract2gf.hs
deleted file mode 100644
index 6fbc1f5da..000000000
--- a/examples/big/extract2gf.hs
+++ /dev/null
@@ -1,28 +0,0 @@
-import System
-import Char
-
--- usage: extract2gf <lang> <extracted>
-
-main = do
- la:f:_ <- getArgs
- let cnc = f ++ ".gf"
- let abs = f ++ "Abs.gf"
- s <- readFile f
- writeFile abs $ "abstract " ++ f ++ "Abs = Cat ** {\n"
- writeFile cnc $ "concrete " ++ f ++ " of " ++ f ++
- "Abs = Cat" ++ la ++ " ** open Paradigms" ++ la ++ " in {\n"
- mapM_ (mkOne abs cnc . words) $ filter (not . empty) $ lines s
- appendFile abs "}"
- appendFile cnc "}"
-
--- format: cat oper args
-
-mkOne abs cnc (cat : oper : args@(a1:_)) = do
- appendFile abs $ " fun " ++ fun ++ " : " ++ cat ++ " ;\n"
- appendFile cnc $ " lin " ++ fun ++ " = " ++ lin ++ " ;\n"
- where
- fun = a1 ++ "_" ++ cat ++ "_" ++ oper
- lin = unwords $ oper:["\"" ++ s ++ "\"" | s <- args]
-mkOne _ _ ws = putStrLn $ unwords ws
-
-empty s = all isSpace s || take 2 s == "--"