antlr4 sql grammar

Chris Snow picture Chris Snow · Jan 22, 2013 · Viewed 20.1k times · Source

Does ANTLR4 have a sql grammar available? If so, where can I find it?

There is a link from the ANTLR wiki, but the link is broken: grammar list

Answer

Bart Kiers picture Bart Kiers · Jan 22, 2013

No, at the time of this writing, there is no v4 SQL grammar.

All v4 grammar will be put into the following Github repository (as far as I can remember from the ANTLR mailing list): https://github.com/antlr/grammars-v4

The v3 grammars here now: http://antlr3.org/grammar/list.html

EDIT - April 2018

There is now a user contributed MySQL grammar here: [dead link removed]

EDIT - February 2020

MySQL, T-SQL, PL/SQL, and SQLite grammars are all available here: https://github.com/antlr/grammars-v4/tree/master/sql