mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
Imper
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
module PrLBNF (prLBNF) where
|
||||
module PrLBNF (prLBNF,prBNF) where
|
||||
|
||||
import CF
|
||||
import CFIdent
|
||||
@@ -16,6 +16,16 @@ import Char
|
||||
prLBNF :: CF -> String
|
||||
prLBNF = unlines . (map prCFRule) . rulesOfCF -- hiding the literal recogn function
|
||||
|
||||
-- a hack to hide the LBNF details
|
||||
prBNF :: CF -> String
|
||||
prBNF = unlines . (map (unwords . unLBNF . drop 1 . words . prCFRule)) . rulesOfCF
|
||||
where
|
||||
unLBNF r = case r of
|
||||
"---":ts -> ts
|
||||
";":"---":ts -> ts
|
||||
c:ts -> c : unLBNF ts
|
||||
_ -> r
|
||||
|
||||
prCFRule :: CFRule -> String
|
||||
prCFRule (fun,(cat,its)) =
|
||||
prCFFun fun ++ "." +++ prCFCat True cat +++ "::=" +++ --- err in cat -> in syntax
|
||||
|
||||
Reference in New Issue
Block a user