. */ /** * QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement * * @package Doctrine * @subpackage Query * @author Guilherme Blanco * @author Janne Vanhala * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://www.phpdoctrine.org * @since 2.0 * @version $Revision$ */ class Doctrine_ORM_Query_Parser_QueryLanguage extends Doctrine_ORM_Query_ParserRule { public function syntax() { // QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement switch ($this->_parser->lookahead['type']) { case Doctrine_ORM_Query_Token::T_SELECT: return $this->parse('SelectStatement'); break; case Doctrine_ORM_Query_Token::T_UPDATE: return $this->parse('UpdateStatement'); break; case Doctrine_ORM_Query_Token::T_DELETE: return $this->parse('DeleteStatement'); break; default: $this->_parser->syntaxError('SELECT, UPDATE or DELETE'); break; } } }