Zephyr
CodeMirror 6 meets ANTLR
👋 Hello there!
Zephyr is a tiny language written in an ANTLR grammar with a very thin layer on top of what you get out of the box from ANTLR (basically, the bare minimum). The goal of this little language is to be used as an example for connecting CodeMirror 6 to an ANTLR style grammar.
CodeMirror 6 was built around Lezer, its own parser system. Lezer has support for common languages, and has a grammar syntax if you want to use Lezer. But, what if you've already written a grammar and parser, and don't want to rewrite it for CodeMirror 6 compatibility?
This demo shows how to do just that–view the source on GitHub to see how it works.
Why “Zephyr”? I asked ChatGPT to make up a name for this little language and it said:
How about “Zephyr”? It suggests a fresh, light, and airy language that can help developers build software quickly and easily. It also sounds distinct and memorable, which can help it stand out in a crowded programming language landscape.
Editor
Token Preview
This table includes a live preview of all of the tokens in the editor.
Change the editor to see the tokens change!
- typeIndex: 5
- typeName: blockComment
- startIndex: 0
- stopIndex: 314
- typeIndex: 6
- typeName: lineComment
- startIndex: 316
- stopIndex: 370
- typeIndex: 6
- typeName: lineComment
- startIndex: 373
- stopIndex: 420
- typeIndex: 1
- typeName: const
- startIndex: 422
- stopIndex: 426
- typeIndex: