diff --git a/draft/Doctrine/Query/Production/AbstractSchemaName.php b/draft/Doctrine/Query/Production/AbstractSchemaName.php index 0d2ef3eee..9e9d78294 100644 --- a/draft/Doctrine/Query/Production/AbstractSchemaName.php +++ b/draft/Doctrine/Query/Production/AbstractSchemaName.php @@ -49,22 +49,14 @@ class Doctrine_Query_Production_AbstractSchemaName extends Doctrine_Query_Produc */ public function execute(array $params = array()) { - $table = null; $token = $this->_parser->lookahead; if ($token['type'] === Doctrine_Query_Token::T_IDENTIFIER) { - - $table = $this->_parser->getConnection()->getTable($token['value']); - - if ($table === null) { - $this->_parser->logError('Table named "' . $name . '" does not exist.'); - } - $this->_parser->match(Doctrine_Query_Token::T_IDENTIFIER); } else { $this->_parser->logError('Identifier expected'); } - return $table; + return $token; } } diff --git a/draft/Doctrine/Query/Production/IdentificationVariable.php b/draft/Doctrine/Query/Production/IdentificationVariable.php index d19fe3cdf..b92c9c85c 100644 --- a/draft/Doctrine/Query/Production/IdentificationVariable.php +++ b/draft/Doctrine/Query/Production/IdentificationVariable.php @@ -15,5 +15,6 @@ class Doctrine_Query_Production_IdentificationVariable extends Doctrine_Query_Pr $this->error('"' . $name . '" is not a identification variable.'); } */ + return $token; } } diff --git a/draft/Doctrine/Query/Production/IdentificationVariableDeclaration.php b/draft/Doctrine/Query/Production/IdentificationVariableDeclaration.php index bd388a914..3e1b9ea8d 100644 --- a/draft/Doctrine/Query/Production/IdentificationVariableDeclaration.php +++ b/draft/Doctrine/Query/Production/IdentificationVariableDeclaration.php @@ -6,11 +6,12 @@ class Doctrine_Query_Production_IdentificationVariableDeclaration extends Doctri { public function execute(array $params = array()) { - $this->RangeVariableDeclaration(); + $rangeVarDecl = $this->RangeVariableDeclaration(); while ($this->_isNextToken(Doctrine_Query_Token::T_LEFT) || - $this->_isNextToken(Doctrine_Query_Token::T_INNER) || - $this->_isNextToken(Doctrine_Query_Token::T_JOIN)) { + $this->_isNextToken(Doctrine_Query_Token::T_INNER) || + $this->_isNextToken(Doctrine_Query_Token::T_JOIN)) { + $this->Join(); } } diff --git a/draft/Doctrine/Query/Production/Join.php b/draft/Doctrine/Query/Production/Join.php index 77a7fd848..13aaabb35 100644 --- a/draft/Doctrine/Query/Production/Join.php +++ b/draft/Doctrine/Query/Production/Join.php @@ -19,7 +19,7 @@ class Doctrine_Query_Production_Join extends Doctrine_Query_Production $this->_parser->match(Doctrine_Query_Token::T_JOIN); - $this->PathExpression(); + $this->RangeVariableDeclaration(); $this->_parser->match(Doctrine_Query_Token::T_AS); $this->_parser->match(Doctrine_Query_Token::T_IDENTIFIER); diff --git a/draft/Doctrine/Query/Production/RangeVariableDeclaration.php b/draft/Doctrine/Query/Production/RangeVariableDeclaration.php index b40c14e5a..74a7df0f8 100644 --- a/draft/Doctrine/Query/Production/RangeVariableDeclaration.php +++ b/draft/Doctrine/Query/Production/RangeVariableDeclaration.php @@ -6,12 +6,15 @@ class Doctrine_Query_Production_RangeVariableDeclaration extends Doctrine_Query_ { public function execute(array $params = array()) { - $this->AbstractSchemaName(); + $abstractSchemaName = $this->AbstractSchemaName(); if ($this->_isNextToken(Doctrine_Query_Token::T_AS)) { $this->_parser->match(Doctrine_Query_Token::T_AS); } - $this->IdentificationVariable(); + $identifier = $this->IdentificationVariable(); + + return array('abstractSchemaName' => $abstractSchemaName, + 'identifier' => $identifier); } } diff --git a/draft/query-language.txt b/draft/query-language.txt index c9244789e..bf2ecfab3 100644 --- a/draft/query-language.txt +++ b/draft/query-language.txt @@ -36,8 +36,8 @@ UpdateItem = PathExpression "=" (Expression | "NULL") IdentificationVariableDeclaration = RangeVariableDeclaration {Join} RangeVariableDeclaration = AbstractSchemaName ["AS"] IdentificationVariable -Join = ["LEFT" | "INNER"] "JOIN" PathExpression ["AS"] IdentificationVariable [("ON" | "WITH") ConditionalExpression] [IndexBy] -IndexBy = "INDEXBY" PathExpression +Join = ["LEFT" | "INNER"] "JOIN" RangeVariableDeclaration [("ON" | "WITH") ConditionalExpression] [IndexBy] +IndexBy = "INDEX" "BY" PathExpression ConditionalExpression = ConditionalTerm {"OR" ConditionalTerm} ConditionalTerm = ConditionalFactor {"AND" ConditionalFactor}