-- | Examples for Pinchot are in this hierarchy. Start out with -- "Pinchot.Examples.Postal", which contains a sample grammar. -- Next, "Pinchot.Examples.SyntaxTrees" shows you how to convert -- your grammar to data types, and "Pinchot.Examples.AllRulesRecord" -- shows how to make a product type holding an Earley -- 'Text.Earley.Prod' for every 'Rule' in your grammar. Then, -- "Pinchot.Earley" shows how to generate the Earley -- 'Text.Earley.Grammar' you need to actually parse strings. -- -- "Pinchot.Examples.Terminalize" shows you how to generate data -- types that will reduce any 'Rule' to the sequence of terminal -- tokens from which it came. This can be useful not only for -- reconstructing the source text, but also for determining where in -- the source text a production was found. -- -- "Pinchot.Examples.RulesToOptics" shows how to generate lenses and -- isos, which are valuable for navigating and manipulating large trees. -- -- Finally, "Pinchot.Examples.Newman" shows how to actually run the -- Earley parsers, find the locations of various productions, and -- show the results on-screen. You can play with -- 'Pinchot.Examples.Newman.address' and -- 'Pinchot.Examples.Newman.addressFromFile' in GHCi. Or, if you -- compile the Pinchot package using the @executables@ flag, you -- will get an executable named @newman@ that you can play with from -- the command line. -- -- Similar to the 'Pinchot.Examples.Newman.address' is -- 'Pinchot.Examples.Newman.addressPretty'; the difference is that -- 'Pinchot.Examples.Newman.addressPretty' uses the pretty printer -- from the @pretty-show@ package, while -- 'Pinchot.Examples.Newman.address' uses a hand-written -- pretty printer. The @newmanPretty@ address uses -- 'Pinchot.Examples.Newman.addressPretty'. module Pinchot.Examples where