Giter VIP home page Giter VIP logo

Comments (3)

Alhadis avatar Alhadis commented on May 20, 2024 2

I'll see what I can do. πŸ‘ Rather than modify EBNF's grammar, though, it'll be better to add a dedicated grammar for LEBNF instead. Lark's format is well-defined and uses a non-conflicting file extension, whereas ebnf.cson attempts to accommodate every syntax variation that might be encountered in .ebnf files (which rarely conform to ISO/IEC 14977).

I have no idea on how to write an atom grammar (I find it poorly documented on atom.io)

It's actually TextMate's grammar format, adopted by Atom/GitHub, VSCode, and Sublime Text. Each have different requirements on file format: Atom uses CSON/JSON, VSCode and TextMate use XML property lists, and Sublime uses YAML. Regardless of their representation, all TextMate-compatible grammars are structurally similar, and the ones you'll encounter are often converted from a TextMate bundle (except mine… I proudly pen them all from scratch).

Other than TextMate's grammar reference, the only other reliable source of info (that I know of) is this blog post. It covers several critical (but undocumented) details of writing a TMCG, and discusses the hacks necessary to work around TextMate's notorious lack of multiline pattern support.

from language-grammars.

Alhadis avatar Alhadis commented on May 20, 2024 2

Righto, all done! This covers everything in both the docs and Lark's own grammar definition. Here's a preview:

Figure 1

from language-grammars.

Alhadis avatar Alhadis commented on May 20, 2024 1

I've also submitted a PR to have Lark grammars supported/highlighted on GitHub. See github-linguist/linguist#5049.

from language-grammars.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.