[antlr-interest] MySQL grammar -- can I submit?
Maciej Gawinecki
mgawinecki at gmail.com
Sun May 10 03:16:03 PDT 2009
Dear all,
I've started to work on MySQL dialect of SQL grammar as I haven't found
anything like this on the net. Unfortunately, the grammer is currently
incomplete as I don't have time to continue the project due some
deadlines and other projects.
I'm not sure about the quality of my solution, as I'm a newbie to ANTLR
and this was my first project on grammars for this framework. I've
studied context-based and context-less grammars and I've used yacc but
it was so many years ago... Nevertheless I still would like to share
with my partial results, to make it maybe starting point for other people.
DOES IT SOUND REASONABLE? DOES IT MAKE ANY SENSE FOR YOU, AS A COMMUNITY?
Regards,
Maciej
Technical details:
* The grammar was created on the base of yacc grammar provided in MySQL
5.1 source distribution (particularly 'sql_yacc.yy' file). Parts of
lexer for type casting (recognizing different integer types) I've
adopted into Java acion also from MySQL source distribution.
* The grammar is for ANLTR v3 and contains some minor Java actions for
collecting information about: comments (first parser pass on
COMMENTS_CHANNEL) and identifiers of tables/columns (second pass on
DEFAULT_CHANNEL). They can be easiliy removed.
* More complete are parts relating to CREATE TABLE section, as it was of
my main interest.
More information about the antlr-interest
mailing list