Hacker News new | ask | show | jobs
by mingodad 660 days ago
Also there was several requests to create a more formal grammar to describe the grammars but the tree-sitter developers doesn't like the idea and reject then.

But some people did nice attempts like https://github.com/eatkins/tree-sitter-ebnf-generator that I also adapted and exposed it here https://mingodad.github.io/lua-wasm-playground/ to allow play with it online (select "Tree-sitter-ebnf-generator" from examples then click "Run" to see a "grammar.js" generated from the content in "Input Text (arg[1])").

1 comments

I've added more non trivial grammars Javascript, Java, Kotlin, PHP, C, CPP, Rust, Ruby, CSS, HTML, Python using a quickjs script to convert "src/grammar.json" to an EBNF understood by https://mingodad.github.io/lua-wasm-playground/ (the script is here https://github.com/mingodad/plgh/blob/main/json2ebnf-lua.js).