mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
CFGtoPGF is now extended to support context-free grammars with primitive parameters
This commit is contained in:
@@ -89,8 +89,8 @@ compileCFFiles opts fs = do
|
||||
bnfc_rules <- fmap concat $ mapM (getBNFCRules opts) fs
|
||||
let rules = bnfc2cf bnfc_rules
|
||||
startCat <- case rules of
|
||||
(CFRule cat _ _ : _) -> return cat
|
||||
_ -> fail "empty CFG"
|
||||
(Rule cat _ _ : _) -> return cat
|
||||
_ -> fail "empty CFG"
|
||||
let pgf = cf2pgf (last fs) (uniqueFuns (mkCFG startCat Set.empty rules))
|
||||
unless (flag optStopAfterPhase opts == Compile) $
|
||||
do probs <- liftIO (maybe (return . defaultProbabilities) readProbabilitiesFromFile (flag optProbsFile opts) pgf)
|
||||
|
||||
Reference in New Issue
Block a user