mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-29 22:42:52 -06:00
Added support for cf and ebnf formats
This commit is contained in:
@@ -52,7 +52,7 @@ getCFRule :: String -> String -> Err CFRule
|
||||
getCFRule mo s = getcf (wrds s) where
|
||||
getcf ww | length ww > 2 && ww !! 2 `elem` ["->", "::="] =
|
||||
Ok (string2CFFun mo (init fun), (string2CFCat mo cat, map mkIt its)) where
|
||||
fun : cat : _ : its = words s
|
||||
fun : cat : _ : its = ww
|
||||
mkIt ('"':w@(_:_)) = atomCFTerm (string2CFTok (init w))
|
||||
mkIt w = CFNonterm (string2CFCat mo w)
|
||||
getcf _ = Bad (" invalid rule:" +++ s)
|
||||
|
||||
Reference in New Issue
Block a user