Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Configurable "equality" symbol in production rule #29

Open
GavinHigham opened this issue Sep 17, 2020 · 3 comments
Open

Comments

@GavinHigham
Copy link

Many grammars use different equality symbols to separate the left and right sides of a production rule:
symbol ::= replacement
symbol = replacement
symbol → replacement

If this symbol was configurable, it would make it easier to use these grammars with the tool.

@GavinHigham GavinHigham changed the title Configurable "equality" symbol in production rule Feature Request: Configurable "equality" symbol in production rule Sep 18, 2020
@katef
Copy link
Owner

katef commented Sep 20, 2020

I wonder if it would make sense to attempt to provide a "generic" BNF dialect, where this (and #28 and other aspects) are configurable. This might be enough to deal with W3C, lua, the C standard and a few other "casual" dialects.

The only dialects implemented currently are standardised ones - that is, formally specified by a particular standards body. I've resisted adding an add-hoc dialect, because of course everybody writes theirs differently. Details like escapes within strings get difficult. But I can imagine exposing a bunch of settings like this.

Maybe the syntax is fixed, but the lexing is configurable?

@mingodad
Copy link

Look here for how this project seems to manage configuration: https://github.com/gotthardp/bnfparser2/tree/master/parser/share/syntax

@mingodad
Copy link

mingodad commented Mar 25, 2021

Also would be nice if kgt could support the EBNF supported by https://www.bottlecaps.de/rr/ui I did converted several (64) grammars to it here https://github.com/mingodad/plgh and would like to have then been managed by kgt

tree-sitter-abnf.ebnf
tree-sitter-agda.ebnf
tree-sitter-bash.ebnf
tree-sitter-beancount.ebnf
tree-sitter-carp.ebnf
tree-sitter-c.ebnf
tree-sitter-clojure.ebnf
tree-sitter-cpp.ebnf
tree-sitter-c-sharp.ebnf
tree-sitter-css.ebnf
tree-sitter-dart.ebnf
tree-sitter-elm.ebnf
tree-sitter-embedded-template.ebnf
tree-sitter-eno.ebnf
tree-sitter-erlang.ebnf
tree-sitter-fennel.ebnf
tree-sitter-fortran.ebnf
tree-sitter-go.ebnf
tree-sitter-graphql.ebnf
tree-sitter-haskel.ebnf
tree-sitter-html.ebnf
tree-sitter-janet.ebnf
tree-sitter-java.ebnf
tree-sitter-javascript.ebnf
tree-sitter-jsdoc.ebnf
tree-sitter-julia.ebnf
tree-sitter-kotlin.ebnf
tree-sitter-lbnf.ebnf
tree-sitter-lean.ebnf
tree-sitter-ledger.ebnf
tree-sitter-lua.ebnf
tree-sitter-markdown.ebnf
tree-sitter-menhir.ebnf
tree-sitter-minizinc.ebnf
tree-sitter-nim.ebnf
tree-sitter-nix.ebnf
tree-sitter-perl.ebnf
tree-sitter-php.ebnf
tree-sitter-powershell.ebnf
tree-sitter-prolog.ebnf
tree-sitter-python.ebnf
tree-sitter-ql.ebnf
tree-sitter-reason.ebnf
tree-sitter-r.ebnf
tree-sitter-regex.ebnf
tree-sitter-ruby.ebnf
tree-sitter-rust.ebnf
tree-sitter-scala.ebnf
tree-sitter-sexp.ebnf
tree-sitter-sml.ebnf
tree-sitter-sourcepawn.ebnf
tree-sitter-sparql.ebnf
tree-sitter-stan.ebnf
tree-sitter-svelte.ebnf
tree-sitter-swift.ebnf
tree-sitter-systemrdl.ebnf
tree-sitter-teal.ebnf
tree-sitter-toml.ebnf
tree-sitter-turtle.ebnf
tree-sitter-verilog.ebnf
tree-sitter-vhdl.ebnf
tree-sitter-vue.ebnf
tree-sitter-wasm-wast.ebnf
tree-sitter-yaml.ebnf
tree-sitter-zig.ebnf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants