class MysqlParser::StatementParser

Constants

CREATE_TABLE_RE
FINISH_TABLE_RE
INSERT_VALUES_RE
QUOTED_NAME_RE
TABLE_COLUMN_RE
USE_RE

Public Class Methods

parse(input) click to toggle source
# File lib/mysql_parser/statement_parser.rb, line 84
def self.parse(input)
  new.parse(input)
end

Public Instance Methods

parse(input) { |:use, $1| ... } click to toggle source
# File lib/mysql_parser/statement_parser.rb, line 88
def parse(input)
  case input
    when USE_RE           then yield :use,    $1
    when CREATE_TABLE_RE  then yield :create, $1
    when TABLE_COLUMN_RE  then yield :column, $1
    when FINISH_TABLE_RE  then yield :table
    when INSERT_VALUES_RE then yield :insert, $1, $2, $3
  end
end