* @author Louis Lapointe * @link http://pmo.developpez.com/ * @since PhpMyObject v0.1x * @version $Revision: $ * @copyright Copyright (C) 2007-2008 Nicolas Boiteux * @copyright Copyright (C) 2008 Louis Lapointe * @license GPLv3 {@link http://www.gnu.org/licenses/gpl} * @filesource * */ /** * This interface defines the methods a class must implement * to provide a working parser class capable of parsing * a SQL query. * * @package PhpMyObject * @subpackage PMO_Core * @see PMO_MyParser */ interface PMO_Parser{ /** * Add a field viewed by parser * * @throws Exception * @return void */ public function addField($field); /** * Add a table viewed by parser * * @throws Exception * @return void */ public function addTable($table); /** * add an sql function * into function array * * @return void */ public function addFunction($fonction); /** * count the number of fields seen by parser * * @return int */ public function countFields(); /** * extract the name of the tables and fields * from an SQL query and put them * into fields & tables variables * * @throws Exception * @return TRUE */ public function parseRequest($string); /** * fetch the fieldname * stocked in fields PMO_MyArray. * * @return string */ public function fetchField(); /** * fetch tablename stocked * in the fields PMO_MyArray * * @return string */ public function fetchTable(); /** * fetch sql function stocked * in the functions PMO_MyArray * * @return string */ public function fetchFunction(); } ?>