chevrotain
chevrotain copied to clipboard
Option to render token categories as non-terminals in diagrams
Diagrams should render token categories as non-terminals and render all the terminals in the categories. If not by default, then at least optionally. Otherwise diagrams aren't really that useful for documentation purpose (and I don't know what other purpose they could be used for).
I am not sure if categories should be rendered as none terminals as that may be misleading:
- They are not grammar rules and have different semantics.
But I agree there should be some way to visualize the possible set of a Token category.
Up for grabs, help wanted 😄
The big question is what is even possible to implement using the 3rd party diagrams library
- https://github.com/tabatkins/railroad-diagrams
e.g. Does it support dynamically expending diagrams?
Perhaps a simple mitigation would be to expand the terminal tooltip to include a large reg-exp made up of all the possible tokens in the categories?