GPC is a library providing generalized parser combinators which are able to parse all context-free grammars completely. This includes support for left-recursion and reporting all possible parses of ambiguous grammars.
GPC is currently only a proof of concept. Of course it needs a much more elaborate API, but before that I want to implement disambiguation strategies. I have also not put any effort in making this library performant yet.
| Feature | (atto/mega)parsec | happy (LALR) | Earley | GPC |
|---|---|---|---|---|
| No shift-reduce conflicts | βοΈ | β | βοΈ | βοΈ |
| Left-recusion | β | βοΈ | βοΈ | βοΈ |
| Pure Haskell | βοΈ | β | βοΈ | βοΈ |
| Monadic interface | βοΈ | β | β | βοΈ |
| Polynomial time worst-case | β | βοΈ | βοΈ | βοΈ |
| Linear time worst-case | β | βοΈ | β | β |
| Linear time possible | βοΈ | βοΈ | β | βοΈ |
| Disambiguation annotations | β | β | β | planned |