mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-07 10:12:51 -06:00
example generation started
This commit is contained in:
16
lib/resource-1.0/api/examples/mkgfs.hs
Normal file
16
lib/resource-1.0/api/examples/mkgfs.hs
Normal file
@@ -0,0 +1,16 @@
|
||||
-- to process constructor examples to lin commans
|
||||
|
||||
main = mkgfs
|
||||
|
||||
src = "ExxI.gf"
|
||||
script = "exx.gfs"
|
||||
|
||||
mkgfs = do
|
||||
writeFile script ""
|
||||
readFile src >>= (mapM addLin . lines)
|
||||
|
||||
|
||||
addLin s = case words s of
|
||||
c@('e':'x':_):_ -> appendFile script ("l " ++ c ++ "\n")
|
||||
_ -> return ()
|
||||
|
||||
Reference in New Issue
Block a user