How can ebnf notation be used to add a new language to Codemirror?

It’d be great if codemirror (perhaps the new version 6) had direct support for EBNF grammars. I’m using ANTLR to specify a custom language for a project and will most likely use codemirror for the stylized display. Being able to use the same grammar for the language parsing and codemirror would greatly simplify the process. But it may be possible to define an EBNF grammar and use ANTLR to translate that into the codemirror specific parser. ANTLR has a javascript target so should be possible.

1 Like