chevrotain icon indicating copy to clipboard operation
chevrotain copied to clipboard

Option to render token categories as non-terminals in diagrams

Open AccessViolator opened this issue 4 years ago • 2 comments

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).

AccessViolator avatar Feb 29 '20 01:02 AccessViolator

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 😄

bd82 avatar Feb 29 '20 02:02 bd82

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?

bd82 avatar Aug 10 '23 10:08 bd82