I'd rather not create the grammar myself. I did download a 'grammar' but it is written in a non-standard form for ANTLR or Yacc and it contains lexer statements. It would take me some time to separate the two and to introduce the correct syntax for a parser generator.
Is there a BNF grammar available for SQL?
There are lots of SQL grammars suitable for parser generators, since most SQL processors use parser generators to produce their parsers. These might or might not serve your needs, depending on which SQL dialect you are interested in, and which parser generator you are planning on using.
Here are a few examples. These are all taken from official code repositories for the respective databases, which I believe avoids the "opinion-based" criterion for avoiding resource requests. There are also many non-official grammars scattered around the internet, particularly on Github, but not all of them are correct or usable.
© 2022 - 2024 — McMap. All rights reserved.