ollef / Earley

Parsing all context-free grammars using Earley's algorithm in Haskell.
BSD 3-Clause "New" or "Revised" License
363 stars 24 forks source link

Generate ABNF/EBNF from Earley grammar #44

Open seagreen opened 5 years ago

seagreen commented 5 years ago

Any idea how hard this would be to do? If Earley could generate EBNF then users could pass it to tools like GrammKit to make nice diagrams for their grammar.

ollef commented 5 years ago

Sounds quite doable if you're prepared to adapt your grammars a bit. As the library stands you could use <?> as a way to label what you cannot reify, e.g. to give a string description of your terminals or to give your rules names.