#ifndef _MYSQL_SQL_SCRIPT_SPLITTER_H_
#define _MYSQL_SQL_SCRIPT_SPLITTER_H_


#include <list>
#include <string>


namespace mysql_parser
{
class MyxStatementParser;
typedef struct charset_info_st CHARSET_INFO;
}
using namespace mysql_parser;


/** Splits given SQL script into separate statements.
 * 
 * @ingroup sqlparser
 */
class Mysql_sql_script_splitter
{
private:
  static int execute_sql_statement(const MyxStatementParser *splitter, const char *sql, void *userdata);
  static int process_statement(const MyxStatementParser *splitter, const char *sql, void *userdata);
  CHARSET_INFO *_cs;
public:
  Mysql_sql_script_splitter();
  ~Mysql_sql_script_splitter();
  int process(const std::string &sql, std::list<std::string> &statements);
};


#endif // _MYSQL_SQL_SCRIPT_SPLITTER_H_
