Grammar for Lezer Grammar


I have used the code mirror library in some of my projects. I love this library. So, I was quite interested by the new approach of the version 6.

As a way to learn the lezer grammar, I have created a grammar to parse the lezer grammar itself. The repository is available at

Feel free to use or fork it if you want.


Ahhhhh, I was doing exactly the same thing a few hours ago. Never mind.

Ha, very nice! You missed block comments, non-quote escapes in literals and character sets (you can do most of the ones that are allowed in JS strings), and the std.something notation is supposed to be general (the parser just parses a namespaced identifiers, the compiler interprets its meaning), but other than that it looks really accurate.

1 Like