pinchot-0.14.0.0: Build parsers and ASTs for context-free grammars

Safe HaskellNone
LanguageHaskell2010

Pinchot.Examples.EarleyProduct

Description

Provides an example of the use of earleyProduct. You will want to look at the source code, as looking at only the Haddocks will show you only the result of all the Template Haskell splices.

Synopsis

Documentation

allProductions :: Grammar r (Productions r) Source

earleyProduct gives you a big product type that has every rule that is in your Pinchot grammar.

addressParser :: Grammar r (Prod r String Char Address) Source

To get the exact production you're interested in, just use fmap. Then you can use this value for parser.