src/POData/UriProcessor/QueryProcessor/ExpressionParser/ExpressionProcessor.php
/**
     * Recursive function to process each node of the expression
     * 
     * @param AbstractExpression $expression Current node to process.
     * 
     * @return string The language specific expression.
     */
Recursive function to process each node of the expression

@param AbstractExpression $expression Current node to process.

@return string The language specific expression.
Recursive function to process each node of the expression @param AbstractExpression $expression Current node to process . @return string The language specific expression .
private function _processExpressionNode(AbstractExpression $expression)
    {
        if ($expression instanceof ArithmeticExpression) {
            $left = $this->_processExpressionNode($expression->getLeft());
            $right = $this->_processExpressionNode($expression->getRight());
            return $this->_expressionProvider->onArithmeticExpression(
                $expression->getNodeType(), 
                $left, 
                $right
            );
        }
        if ($expression instanceof LogicalExpression) {
            $left = $this->_processExpressionNode($expression->getLeft());
            $right = $this->_processExpressionNode($expression->getRight());
            return $this->_expressionProvider->onLogicalExpression(
                $expression->getNodeType(), 
                $left, 
                $right
            );
        }
        if ($expression instanceof RelationalExpression) {
            $left = $this->_processExpressionNode($expression->getLeft());
            $right = $this->_processExpressionNode($expression->getRight());
            return $this->_expressionProvider->onRelationalExpression(
                $expression->getNodeType(), 
                $left, 
                $right
            );
        }
        if ($expression instanceof ConstantExpression) {
            return $this->_expressionProvider->onConstantExpression(
                $expression->getType(), 
                $expression->getValue()
            );
        }
        if ($expression instanceof PropertyAccessExpression) {
            return $this->_expressionProvider->onPropertyAccessExpression(
                $expression
            );
        }
        if ($expression instanceof FunctionCallExpression) {
            $params = array();
            foreach ($expression->getParamExpressions() as $paramExpression) {
                $params[] = $this->_processExpressionNode($paramExpression);
            }
            return $this->_expressionProvider->onFunctionCallExpression(
                $expression->getFunctionDescription(), 
                $params
            );
        }
        if ($expression instanceof UnaryExpression) {
            $child = $this->_processExpressionNode($expression->getChild());
            return $this->_expressionProvider->onUnaryExpression(
                $expression->getNodeType(), 
                $child
            );
        }
    }
private function _processExpressionNode ( AbstractExpression $ expression ) { if ( $ expression instanceof ArithmeticExpression ) { $ left = $ this -> _processExpressionNode ( $ expression -> getLeft ( ) ) ; $ right = $ this -> _processExpressionNode ( $ expression -> getRight ( ) ) ; return $ this -> _expressionProvider -> onArithmeticExpression ( $ expression -> getNodeType ( ) , $ left , $ right ) ; } if ( $ expression instanceof LogicalExpression ) { $ left = $ this -> _processExpressionNode ( $ expression -> getLeft ( ) ) ; $ right = $ this -> _processExpressionNode ( $ expression -> getRight ( ) ) ; return $ this -> _expressionProvider -> onLogicalExpression ( $ expression -> getNodeType ( ) , $ left , $ right ) ; } if ( $ expression instanceof RelationalExpression ) { $ left = $ this -> _processExpressionNode ( $ expression -> getLeft ( ) ) ; $ right = $ this -> _processExpressionNode ( $ expression -> getRight ( ) ) ; return $ this -> _expressionProvider -> onRelationalExpression ( $ expression -> getNodeType ( ) , $ left , $ right ) ; } if ( $ expression instanceof ConstantExpression ) { return $ this -> _expressionProvider -> onConstantExpression ( $ expression -> getType ( ) , $ expression -> getValue ( ) ) ; } if ( $ expression instanceof PropertyAccessExpression ) { return $ this -> _expressionProvider -> onPropertyAccessExpression ( $ expression ) ; } if ( $ expression instanceof FunctionCallExpression ) { $ params = array ( ) ; foreach ( $ expression -> getParamExpressions ( ) as $ paramExpression ) { $ params [ ] = $ this -> _processExpressionNode ( $ paramExpression ) ; } return $ this -> _expressionProvider -> onFunctionCallExpression ( $ expression -> getFunctionDescription ( ) , $ params ) ; } if ( $ expression instanceof UnaryExpression ) { $ child = $ this -> _processExpressionNode ( $ expression -> getChild ( ) ) ; return $ this -> _expressionProvider -> onUnaryExpression ( $ expression -> getNodeType ( ) , $ child ) ; } }
Recursive function to process each node of the expression
Recursive function to process each node of the expression