BNF syntax

Welcome!

Julia’s syntax is implicit in JuliaSyntax.jl stdlib, but yes, there’s no official BNF syntax I know of, nor unofficial I know of, except one “I” made below. The syntax is stable since 2018, version 1.0, and very rarely added to, still it’s been a bit of a moving target.

You could make it! :slight_smile: If you think useful for others. It’s also implicit in other older femtolisp (i.e. Scheme language the AI mentions, likely still in sync) parser, AND some other tools, for syntax highlighting, linters etc. so it may be available (in whole, though I doubt it, or) in part.

You could seemingly use RBNF.jl. Some parts for sure have BNF, like regexes are standard PCRE2 syntax, and there’s BNF for e.g. floating point numbers, Julia parses standard formats (I’m though not sure, probably same as in C or maybe superset of its BNF) e.g. 3_000.5f0 for Float32; f or e needs to be lower case and a number after unlike e.g.:

I made a BNF for you, reads: I made the AI do it for you… take it with a grain of salt (maybe it’s a good starting point, even if not fully correct from the start):

1 Like