Earley
Earley copied to clipboard
Parsing all context-free grammars using Earley's algorithm in Haskell.
I was working on AoC problem (https://adventofcode.com/2021/day/10) recently and saw that recognizing whether an input matches a grammar was part of it. (I ended up going a different direction to...
Consider this code: ```haskell {-# LANGUAGE Haskell2010 #-} {-# LANGUAGE RecursiveDo #-} import Text.Earley import Control.Applicative data L = A | B | C deriving (Eq, Show) lang :: Grammar...
So far I was able to find one library on Hackage for testing ambiguity of arbitrary CFGs using brute force: "Earley". If you know any other library, please, let me...
Hello. I did not find how to implement some sort of constraints on production. For example if I wrote a rule to parse a series of digits and wanted to...
``` grammar = mdo r
Any idea how hard this would be to do? If Earley could generate EBNF then users could pass it to tools like [GrammKit](https://github.com/dundalek/GrammKit) to make nice diagrams for their grammar.
It would be nice to be able to capture the result of a production as well as the text matched by it, for example: ```haskell match :: Prod r e...
The author of Marpa [claims](https://jeffreykegler.github.io/personal/timeline_v3#h1-2010_leo_1991_is_implemented) it to be an improvement over Joop Leo’s ’91 paper. Has [Marpa](http://savage.net.au/Marpa.html) influenced this library’s implementation?
Are there any recommendations on how I could do error recovery to report multiple errors?
below, `edit` has nullable rules, and `insertion` has a wildcard. the parse results are all present, but some alternatives that appear before other alternatives ("lexically" in the grammar), appear later...