Centril / sublime-lbnf-syntax

Syntax for LBNF
MIT License
2 stars 0 forks source link

Support for character class abbreviations #1

Open jchook opened 5 years ago

jchook commented 5 years ago

Chapter 5.1 of the LBNF report outlines a way to succinctly specify character classes.

The regular expression syntax of LBNF is specified in the Appendix. The abbreviations with strings in brackets need a word of explanation: ["abc7%"] denotes the union of the characters ’a’ ’b’ ’c’ ’7’ ’%’ {"abc7%"} denotes the sequence of the characters ’a’ ’b’ ’c’ ’7’ ’%’

However the Sublime grammar does not appear to support those.

Centril commented 5 years ago

Unfortunately I'm not using Sublime nor LBNF myself these days and won't have time to implement support for this. That said, I'd be happy to receive contributions. :)

jchook commented 5 years ago

Thanks for the follow-up.

Curious, did you stop using LBNF because you now use a better tool, or because you no longer need to write lexers / parsers?

Centril commented 5 years ago

I don't use bnfc anymore since it was just a part of my compilers and PLT courses and I don't need to create languages from scratch in e.g. Haskell. These days I'm a language designer for Rust and we use a hand written parser (and we're building up a parser generator for the specification work). That said, LBNF is still an excellent tool if you need that sort of tool.

jchook commented 5 years ago

These days I'm a language designer for Rust and we use a hand written parser

Awesome!! Sounds like rewarding work.

That said, LBNF is still an excellent tool if you need that sort of tool.

I agree. Surprising how few devs use a tool like this. All said-and-done, I ended up hand-writing an LL(1) parser for my task. Thoroughly enjoyed the process, and writing my grammar in LBNF first made it much easier.

Also, thank you(!) for writing and publishing the LBNF sublime extension. It helped me write/learn LBNF much faster thanks to syntax highlighting revealing errors early.

Centril commented 5 years ago

Awesome!! Sounds like rewarding work.

It is! (A lot of work tho =P)

If you are interested in language and compiler development, the Rust project is very open to new contributors!

Thoroughly enjoyed the process, and writing my grammar in LBNF first made it much easier.

Oh yeah; it's a great sanity check also. The Rust project is working on formalizing its grammar through a working group using a GLL parser generator.

Also, thank you(!) for writing and publishing the LBNF sublime extension. It helped me write/learn LBNF much faster thanks to syntax highlighting revealing errors early.

❤️ Happy you liked it!