Exakat\Tasks\Load::processOperator PHP Метод

processOperator() приватный Метод

private processOperator ( $atom, $finals, $links = ['LEFT', 'RIGHT'] )
    private function processOperator($atom, $finals, $links = array('LEFT', 'RIGHT'))
    {
        $current = $this->id;
        $additionId = $this->addAtom($atom);
        $left = $this->popExpression();
        $this->addLink($additionId, $left, $links[0]);
        $this->nestContext();
        $finals = array_merge(array(), $finals);
        do {
            $this->processNext();
            if (in_array($this->tokens[$this->id + 1][0], array(T_EQUAL, T_PLUS_EQUAL, T_AND_EQUAL, T_CONCAT_EQUAL, T_DIV_EQUAL, T_MINUS_EQUAL, T_MOD_EQUAL, T_MUL_EQUAL, T_OR_EQUAL, T_POW_EQUAL, T_SL_EQUAL, T_SR_EQUAL, T_XOR_EQUAL))) {
                $this->processNext();
            }
        } while (!in_array($this->tokens[$this->id + 1][0], $finals));
        $this->exitContext();
        $right = $this->popExpression();
        $this->addLink($additionId, $right, $links[1]);
        $x = array('code' => $this->tokens[$current][1], 'fullcode' => $this->atoms[$left]['fullcode'] . ' ' . $this->tokens[$current][1] . ' ' . $this->atoms[$right]['fullcode'], 'line' => $this->tokens[$current][2], 'token' => $this->getToken($this->tokens[$current][0]));
        $this->setAtom($additionId, $x);
        $this->pushExpression($additionId);
        if (!$this->isContext(self::CONTEXT_NOSEQUENCE) && $this->tokens[$this->id + 1][0] === T_CLOSE_TAG) {
            $this->processSemicolon();
        }
        return $additionId;
    }
Load