/* 
 * © 2007-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */
#ifndef _SQL_NORMALIZER_H_
#define _SQL_NORMALIZER_H_


#include "wbpublic_public_interface.h"
#include <map>
#include <string>


#ifndef _WIN32
#include <string.h>
#define stricmp strcasecmp
#endif


/**
 * Defines interface to normalize provided SQL statement.
 * Normalization means transformation of all forms of equivalent SQL statements to the same basis form.
 * Addresses:
 * <li>optional braces
 * <li>optional default values
 * <li>forced quotation of identifiers
 * <li>etc.
 *
 * Used by SQL synchronization.
 * 
 * @ingroup sqlparser
 */
class WBPUBLICBACKEND_PUBLIC_FUNC Sql_normalizer
{
public:
  Sql_normalizer() : _delimiter("\\") {}
  virtual ~Sql_normalizer() {}

  void delimiter(std::string val) { _delimiter= val; }

  virtual std::string normalize(const std::string &sql, const std::string &schema_name)= 0;

protected:
  std::string _delimiter;
};


#endif // _SQL_NORMALIZER_H_
