summaryrefslogtreecommitdiff
path: root/src/GF/Canon/AbsToBNF.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-25 16:43:48 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-25 16:43:48 +0000
commitb96b36f43de3e2f8b58d5f539daa6f6d47f25870 (patch)
tree0992334be13cec6538a1dea22fbbf26ad6bdf224 /src/GF/Canon/AbsToBNF.hs
parentfe367412e0aeb4ad5c02de68e6eca382e0f96984 (diff)
removed src for 2.9
Diffstat (limited to 'src/GF/Canon/AbsToBNF.hs')
-rw-r--r--src/GF/Canon/AbsToBNF.hs38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/GF/Canon/AbsToBNF.hs b/src/GF/Canon/AbsToBNF.hs
deleted file mode 100644
index e30e836da..000000000
--- a/src/GF/Canon/AbsToBNF.hs
+++ /dev/null
@@ -1,38 +0,0 @@
-module GF.Canon.AbsToBNF where
-
-import GF.Grammar.SGrammar
-import GF.Data.Operations
-import GF.Infra.Option
-import GF.Canon.GFC (CanonGrammar)
-
--- AR 10/5/2007
-
-abstract2bnf :: CanonGrammar -> String
-abstract2bnf = sgrammar2bnf . gr2sgr noOptions emptyProbs
-
-sgrammar2bnf :: SGrammar -> String
-sgrammar2bnf = unlines . map (prBNFRule . mkBNF) . allRules
-
-prBNFRule :: BNFRule -> String
-prBNFRule = id
-
-type BNFRule = String
-
-mkBNF :: SRule -> BNFRule
-mkBNF (pfun,(args,cat)) =
- fun ++ "." +++ gfId cat +++ "::=" +++ rhs +++ ";"
- where
- fun = gfId (snd pfun)
- rhs = case args of
- [] -> prQuotedString (snd pfun)
- _ -> unwords (map gfId args)
-
--- good for GF
-gfId i = i
-
--- good for BNFC
-gfIdd i = case i of
- "Int" -> "Integer"
- "String" -> i
- "Float" -> "Double"
- _ -> "G" ++ i ++ "_"