. */ namespace Doctrine\ORM\Query\Parser; /** * 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 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; } } }