| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
BNFC.GetCF
Description
Check LBNF input file and turn it into the CF internal representation.
Synopsis
- parseCF :: SharedOptions -> Target -> String -> IO CF
- parseRawCF :: FilePath -> String -> Err CF
- checkRule :: CF -> Rule -> Maybe String
- transItem :: Item -> [Either Cat String]
- fixTokenCats :: FixTokenCats a => [TokenCat] -> a -> a
Documentation
parseCF :: SharedOptions -> Target -> String -> IO CF Source #
Entrypoint. Parses full CF from LBNF file and checks against all backend requirements
parseRawCF :: FilePath -> String -> Err CF Source #
Parse raw CF from LBNF file without checking backend requirements
transItem :: Item -> [Either Cat String] Source #
Translate a rule item (terminal or non terminal) It also sanitizes the terminals a bit by skipping empty terminals or splitting multiwords terminals. This means that the following rule
Foo. S ::= "foo bar" ""
is equivalent to
Foo. S ::= "foo" "bar"
fixTokenCats :: FixTokenCats a => [TokenCat] -> a -> a Source #