@@ 173-189 (lines=17) @@ | ||
170 | * |
|
171 | * @return AbstractExpression |
|
172 | */ |
|
173 | private function _parseLogicalOr() |
|
174 | { |
|
175 | $this->_recurseEnter(); |
|
176 | $left = $this->_parseLogicalAnd(); |
|
177 | while ($this->_tokenIdentifierIs(ODataConstants::KEYWORD_OR)) { |
|
178 | $logicalOpToken = clone $this->_getCurrentToken(); |
|
179 | $this->_lexer->nextToken(); |
|
180 | $right = $this->_parseLogicalAnd(); |
|
181 | FunctionDescription::verifyLogicalOpArguments($logicalOpToken, $left, $right); |
|
182 | $left = new LogicalExpression( |
|
183 | $left, $right, ExpressionType::OR_LOGICAL |
|
184 | ); |
|
185 | } |
|
186 | ||
187 | $this->_recurseLeave(); |
|
188 | return $left; |
|
189 | } |
|
190 | ||
191 | /** |
|
192 | * Parse logical and (and). |
|
@@ 196-210 (lines=15) @@ | ||
193 | * |
|
194 | * @return AbstractExpression |
|
195 | */ |
|
196 | private function _parseLogicalAnd() |
|
197 | { |
|
198 | $this->_recurseEnter(); |
|
199 | $left = $this->_parseComparison(); |
|
200 | while ($this->_tokenIdentifierIs(ODataConstants::KEYWORD_AND)) { |
|
201 | $logicalOpToken = clone $this->_getCurrentToken(); |
|
202 | $this->_lexer->nextToken(); |
|
203 | $right = $this->_parseComparison(); |
|
204 | FunctionDescription::verifyLogicalOpArguments($logicalOpToken, $left, $right); |
|
205 | $left = new LogicalExpression($left, $right, ExpressionType::AND_LOGICAL ); |
|
206 | } |
|
207 | ||
208 | $this->_recurseLeave(); |
|
209 | return $left; |
|
210 | } |
|
211 | ||
212 | /** |
|
213 | * Parse comparison operation (eq, ne, gt, ge, lt, le) |