diff --git a/lib/Doctrine/ORM/Query/AST/SelectExpression.php b/lib/Doctrine/ORM/Query/AST/SelectExpression.php index 93dea1444..29bb79989 100644 --- a/lib/Doctrine/ORM/Query/AST/SelectExpression.php +++ b/lib/Doctrine/ORM/Query/AST/SelectExpression.php @@ -20,7 +20,8 @@ */ /** - * SelectClause = "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression} + * SelectExpression ::= IdentificationVariable ["." "*"] | StateFieldPathExpression | + * (AggregateExpression | "(" Subselect ")") [["AS"] FieldAliasIdentificationVariable] * * @author Guilherme Blanco * @license http://www.opensource.org/licenses/lgpl-license.php LGPL diff --git a/lib/Doctrine/ORM/Query/Parser/StateField.php b/lib/Doctrine/ORM/Query/Parser/StateField.php new file mode 100644 index 000000000..4f3a57387 --- /dev/null +++ b/lib/Doctrine/ORM/Query/Parser/StateField.php @@ -0,0 +1,50 @@ +. + */ + +/** + * StateField ::= {EmbeddedClassStateField "."}* SimpleStateField + * + * @author Guilherme Blanco + * @author Janne Vanhala + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link http://www.doctrine-doctrine.org + * @since 2.0 + * @version $Revision$ + */ +class Doctrine_ORM_Query_Parser_StateField extends Doctrine_ORM_Query_ParserRule +{ + protected $_AST = null; + + + public function syntax() + { + // StateField ::= {EmbeddedClassStateField "."}* SimpleStateField + $this->_AST = $this->AST('StateField'); + + while ($this->_parser->lookahead['type'] == Doctrine_ORM_Query_Token::T_IDENTIFIER && + $this->_isNextToken(Doctrine_ORM_Query_Token::T_DOT)) { + $this->_AST->addEmbeddedClassStateField($this->parse('EmbeddedClassStateField')); + $this->_parser->match(Doctrine_ORM_Query_Token::T_DOT); + } + + $this->_AST->setSimpleStateField($this->parse('SimpleStateField')); + } +} \ No newline at end of file