1
0
forked from GitHub/gf-core

demo grammar for the resource: mini/MiniGrammar. Generated automatically from MiniGrammarEng by make. Will replace the old demo/ grammars as one that illustrates the grammar structures while being lighter than Lang and generating less junk.

This commit is contained in:
aarne
2011-10-03 14:17:56 +00:00
parent 988c80751e
commit f847344de8
5 changed files with 337 additions and 1 deletions

18
lib/src/mini/MkMini.hs Normal file
View File

@@ -0,0 +1,18 @@
src = "Eng"
langs = ["Afr","Bul","Cat","Dan","Dut","Fin","Fre","Ger","Ita",
"Nep","Nor","Pes","Pol","Pnb","Ron","Rus","Spa","Swe","Urd"]
file lng = "MiniGrammar" ++ lng ++ ".gf"
main = do
s <- readFile (file src)
mapM_ (mkMiniFile s) langs
mkMiniFile s lng =
writeFile (file lng) (mkMini lng s)
mkMini lng s = case s of
'E':'n':'g':cs -> lng ++ mkMini lng cs
c:cs -> c : mkMini lng cs
_ -> s