Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

antlr4 sql grammar

Tags:

antlr4

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

like image 523
Chris Snow Avatar asked Jan 22 '13 17:01

Chris Snow


2 Answers

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

like image 55
Bart Kiers Avatar answered Oct 28 '22 19:10

Bart Kiers


Currently, there are plenty of sql grammars for v4 as well:

  1. MySQL
  2. PL/SQL
  3. T-SQL (Microsoft SQL Server) by KvanTTT
like image 8
Mike Koltsov Avatar answered Oct 28 '22 19:10

Mike Koltsov