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:
18
lib/src/mini/MkMini.hs
Normal file
18
lib/src/mini/MkMini.hs
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user