diff options
| author | krasimir <krasimir@chalmers.se> | 2016-03-21 13:27:44 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2016-03-21 13:27:44 +0000 |
| commit | c8ebe093150509d9f01d82f0d698ef5df09bd985 (patch) | |
| tree | a35dfd20f40c7461a2fe8809668626c09c9a8a85 /src/compiler/GF/Command | |
| parent | da10bb33c73e0742d6aa3aa77d71b2804b2ed673 (diff) | |
initial support for BNFC syntax in context-free grammars for GF. Not all features are supported yet. Based on contribution from Gleb Lobanov
Diffstat (limited to 'src/compiler/GF/Command')
| -rw-r--r-- | src/compiler/GF/Command/Importing.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/GF/Command/Importing.hs b/src/compiler/GF/Command/Importing.hs index 1b520cfc8..f3d93d87b 100644 --- a/src/compiler/GF/Command/Importing.hs +++ b/src/compiler/GF/Command/Importing.hs @@ -5,10 +5,11 @@ import PGF.Internal(optimizePGF,unionPGF,msgUnionPGF) import GF.Compile import GF.Compile.Multi (readMulti) -import GF.Compile.GetGrammar (getCFRules, getEBNFRules) +import GF.Compile.GetGrammar (getBNFCRules, getEBNFRules) import GF.Grammar (SourceGrammar) -- for cc command -import GF.Grammar.CFG +import GF.Grammar.BNFC import GF.Grammar.EBNF +import GF.Grammar.CFG import GF.Compile.CFGtoPGF import GF.Infra.UseIO(die,tryIOE) import GF.Infra.Option @@ -22,7 +23,7 @@ importGrammar :: PGF -> Options -> [FilePath] -> IO PGF importGrammar pgf0 _ [] = return pgf0 importGrammar pgf0 opts files = case takeExtensions (last files) of - ".cf" -> importCF opts files getCFRules id + ".cf" -> importCF opts files getBNFCRules bnfc2cf ".ebnf" -> importCF opts files getEBNFRules ebnf2cf ".gfm" -> do ascss <- mapM readMulti files |
