Skip to content

Repository files navigation

mysql-parser-rb

A MySQL query parser for Ruby.

NOTE: this thing doesn't work yet.

What?

This repo is an attempt to write Ruby bindings for parsers generated by ANTLR. I've started out by generating a parser for MySQL queries, but hopefully that's just the beginning. It would be rad to be able to generate parsers for arbitrary ANTLR grammars and make them available to Ruby, complete with visitors, listeners, etc.

Local Dev

  1. Initialize the ANTLR submodule:
git submodule init
  1. Install dependencies:
bundle install
  1. Generate a makefile:
ruby ext/mysql-parser/extconf.rb
  1. Build
make
  1. Run the test script
bundle exec ruby tester.rb

You should see a segfault. Everything appears to work except for at the very end when Ruby tries to exit. Trying to figure out why. It seems to only happen if a C++ object is referenced in Ruby. It doesn't even have to be retained to cause the segfault, only referenced.

Authors

Cameron C. Dutro https://github.com/camertron

About

A MySQL query parser for Ruby.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages