lib/Languages/Galach/Parser.php
protected function reduceLogicalOr(Node $node, $inGroup = false)
    {
        if ($this->stack->count() <= 1 || !$this->isTopStackToken(Tokenizer::TOKEN_LOGICAL_OR)) {
            return $node;
        }

        // If inside a group don't look for following logical AND
        if (!$inGroup) {
            $this->popWhitespace();
            // If the next token is logical AND, put the node on stack
            // as that has precedence over logical OR
            if ($this->isToken(reset($this->tokens), Tokenizer::TOKEN_LOGICAL_AND)) {
                $this->stack->push($node);

                return null;
            }
        }

        $token = $this->stack->pop();
        $leftOperand = $this->stack->pop();

        return new LogicalOr($leftOperand, $node, $token);
    }
protected function reduceLogicalOr(Node $node, $inGroup = false)
    {
        if ($this->stack->count() <= 1 || !$this->isTopStackToken(Tokenizer::TOKEN_LOGICAL_OR)) {
            return $node;
        }

        // If inside a group don't look for following logical AND
        if (!$inGroup) {
            $this->popWhitespace();
            // If the next token is logical AND, put the node on stack
            // as that has precedence over logical OR
            if ($this->isToken(reset($this->tokens), Tokenizer::TOKEN_LOGICAL_AND)) {
                $this->stack->push($node);

                return null;
            }
        }

        $token = $this->stack->pop();
        $leftOperand = $this->stack->pop();

        return new LogicalOr($leftOperand, $node, $token);
    }
protected function reduceLogicalOr ( Node $ node , $ inGroup = false ) { if ( $ this -> stack -> count ( ) <= 1 || ! $ this -> isTopStackToken ( Tokenizer :: TOKEN_LOGICAL_OR ) ) { return $ node ; } // If inside a group don't look for following logical AND if ( ! $ inGroup ) { $ this -> popWhitespace ( ) ; // If the next token is logical AND, put the node on stack // as that has precedence over logical OR if ( $ this -> isToken ( reset ( $ this -> tokens ) , Tokenizer :: TOKEN_LOGICAL_AND ) ) { $ this -> stack -> push ( $ node ) ; return null ; } } $ token = $ this -> stack -> pop ( ) ; $ leftOperand = $ this -> stack -> pop ( ) ; return new LogicalOr ( $ leftOperand , $ node , $ token ) ; }
Reduce logical OR.

@param \QueryTranslator\Values\Node $node
@param bool $inGroup Reduce inside a group

@return null|\QueryTranslator\Languages\Galach\Values\Node\LogicalOr|\QueryTranslator\Values\Node
Reduce logical OR .